terraform-provider-proxmox icon indicating copy to clipboard operation
terraform-provider-proxmox copied to clipboard

iothread and ssd emulation not enabled during resource creation and modification

Open luifrancisco opened this issue 1 year ago • 3 comments

Describe the bug I have both iothread and ssd set to true but these settings are not properly set on Proxmox even when executing terraform apply the second time.

To Reproduce Steps to reproduce the behavior:

  1. Create a resource by cloning an existing template. This resource should have a resized (larger) scsi0 disk (containing cloud-init image). The template: 9001_template
  2. Run terraform apply and check action preview before execution:
      + disk {
          + cache             = "none"
          + datastore_id      = "nvme-a"
          + discard           = "ignore"
          + file_format       = (known after apply)
          + interface         = "scsi0"
          + iothread          = true
          + path_in_datastore = (known after apply)
          + size              = 20
          + ssd               = true
        }

  1. Confirm yes to terraform apply.
  2. Check Proxmox disk resource: 4101_vm

Here we can see iothread and ssd emulation are not set.

  1. Run terraform apply again and check preview: 4101_vm_2

  2. Confirm yes to terraform apply.

  3. Check Proxmox GUI: 4101_vm_3

This time cache was changed from Default to none.

Resource configuration:


resource "proxmox_virtual_environment_vm" "stg-k8s-master-1" {
  provider = proxmox.pve4
  name        = "stg-k8s-master-1"
  node_name = "pve4"
  vm_id = 4101
  tablet_device = false
  scsi_hardware = "virtio-scsi-single"
  agent {
    enabled = true
  }

  clone {
    vm_id = 9001
    full = true
  }

  cpu {
    cores = 4
    type = "x86-64-v2-AES"
  }

  memory {
    dedicated = 4096
  }

  disk {
    datastore_id = "nvme-a"
    interface = "scsi0"
    size = 20
    iothread = true
    ssd = true
  }

  network_device {
    model = "virtio"
    bridge = "vmbr0"
    firewall = false
    vlan_id = 20
  }

  initialization {
    datastore_id = "nvme-a"
    user_account {
      username = var.ciuser
      password = var.cipassword
      keys = var.sshkeys
    }
    ip_config {
      ipv4 {
        address = "10.20.0.91/24"
        gateway = "10.20.0.1"
      }
    }
  }
}

Expected behavior iothread and ssd emulation should be enabled on resource creation and modification.

Screenshots *Already provided above *

Additional context I have not tried when creating a resource without cloning a template.

  • Single or clustered Proxmox: Single
  • Provider version (ideally it should be the latest version): latest
  • Terraform version: 1.6.6
  • OS (where you run Terraform from): Ubuntu Cinnamon 22.04
  • Debug logs (TF_LOG=DEBUG terraform apply): Will supply if required

luifrancisco avatar Jan 10 '24 04:01 luifrancisco

Also related:

  • https://github.com/bpg/terraform-provider-proxmox/issues/360

bpg avatar Jan 31 '24 02:01 bpg

Marking this issue as stale due to inactivity in the past 180 days. This helps us focus on the active issues. If this issue is reproducible with the latest version of the provider, please comment. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

bpg-autobot[bot] avatar Jul 30 '24 00:07 bpg-autobot[bot]