Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set "Upgrade packages" to "No" because of missing property #997

Closed
evgfilim1 opened this issue Apr 26, 2024 · 10 comments · Fixed by #1049
Closed

Cannot set "Upgrade packages" to "No" because of missing property #997

evgfilim1 opened this issue Apr 26, 2024 · 10 comments · Fixed by #1049
Assignees

Comments

@evgfilim1
Copy link

Proxmox 8.1.10 has an "Upgrade packages" item in "Cloud-init" config.
Upgrade packages item
Upgrade packages dialog

But I can't turn it off via terraform. My .tf file:

terraform {
  required_providers {
    proxmox = {
      source  = "telmate/proxmox"
      version = "3.0.1-rc1"
    }
  }
}

provider "proxmox" {
  pm_api_url          = var.pm_api_url
  pm_api_token_id     = var.pm_api_token_id
  pm_api_token_secret = var.pm_api_token_secret
}

# ... omitted ...

locals {
  ipconfigs = {
    for i, network in var.networks :
    "ipconfig${i}" => network.ipconfig
    if network.ipconfig != null
  }
}

resource "proxmox_vm_qemu" "pve_vm" {
  name        = var.vm_name
  target_node = var.node
  desc        = var.description
  clone       = var.clone_from
  sockets     = var.cpu_sockets
  cores       = var.cpu_cores
  memory      = var.ram_size
  os_type     = var.provisioning_type
  qemu_os     = var.qemu_os_type
  vmid        = var.vm_id
  scsihw      = var.scsi_hw
  agent       = var.qemu_ga_enabled ? 1 : 0
  full_clone  = var.do_full_clone
  tags        = var.tags
  boot        = "order=${var.boot_order}"
  ciuser      = var.default_user_name
  cipassword  = var.default_user_password
  sshkeys     = (
    length(var.default_user_ssh_pubkeys) > 0
    ? join("\n", var.default_user_ssh_pubkeys)
    : null
  )
  nameserver   = var.dns_config.nameserver
  searchdomain = var.dns_config.search
  ipconfig0    = lookup(local.ipconfigs, "ipconfig0", null)
  ipconfig1    = lookup(local.ipconfigs, "ipconfig1", null)
  ipconfig2    = lookup(local.ipconfigs, "ipconfig2", null)
  ipconfig3    = lookup(local.ipconfigs, "ipconfig3", null)
  dynamic "network" {
    for_each = var.networks
    content {
      model  = "virtio"
      bridge = network.value.bridge
    }
  }
  disks {
    scsi {
      scsi0 {
        disk {
          size    = var.disk_size
          storage = var.disk_storage
          backup  = var.disk_do_backup
        }
      }
    }
  }
  serial {
    id   = 0
    type = "socket"
  }
  vga {
    type = "serial0"
  }
  cloudinit_cdrom_storage = "local-lvm"
}

It would be nice to add a ciupgrade or something similar to turn on/off auto upgrading packages on boot.

@maksimsamt
Copy link
Contributor

@Tinyblargon,
Do you plan to implement this feature?
+1 for adding

@Tinyblargon
Copy link
Collaborator

@maksimsamt yes, but it will first need to be added to the upstream proxmox SDK.

@Tinyblargon
Copy link
Collaborator

I am currently working on this upstream. It's gonna be a bit more work than just adding a setting. This is a good moment to group all the cloud-init things into a separate data structure.

@Tinyblargon
Copy link
Collaborator

Telmate/proxmox-api-go#339

@Tinyblargon
Copy link
Collaborator

@evgfilim1 Could you check if #1049 fixes this for you?

@maksimsamt
Copy link
Contributor

@Tinyblargon,
I've checked and tested #1049 ciupgrade argument and it works.
It can be disabled (false) and reverted back (true).
One note, this change should initiate automatic reboot after ciupgrade change if automatic_reboot is enabled.
The current implementation does not trigger a reboot.

@Tinyblargon
Copy link
Collaborator

@maksimsamt agreed, but it only needs to reboot when it goes from False to True

@Tinyblargon
Copy link
Collaborator

Tinyblargon commented Jun 21, 2024

@maksimsamt changing ciupgrade from false to true now restarts the VM, Changing it from true to false does not cause a reboot.

@Tinyblargon
Copy link
Collaborator

Setting ciupgrade on PVE versions lower than 8.0.0 causes issue Telmate/proxmox-api-go#344

@JosBritton
Copy link

@evgfilim1 Could you check if #1049 fixes this for you?

Tested #1049 and works well, a great QoL feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants