nutanix / terraform-provider-nutanix

Terraform Nutanix Provider
https://www.terraform.io/docs/providers/nutanix/
Mozilla Public License 2.0
95 stars 111 forks source link

Additional disk not added when cloning a VM #579

Open fabricekrebs opened 1 year ago

fabricekrebs commented 1 year ago

When cloning a VM, and in the mean time adding an additional disk, the VM is cloned but no additional disk is added.

For example when applying this configuration, the disk with device index 4 isn't added

#create a virtual machine, with required information
resource "nutanix_virtual_machine" "vm" {
  name                 = var.vm_name
  cluster_uuid         = data.nutanix_cluster.cluster.id
  num_vcpus_per_socket = "2"
  num_sockets          = "1"
  memory_size_mib      = 2048

  guest_customization_cloud_init_user_data  = "xxxxx"

  parent_reference = {
    kind = "vm"
    name = "source-vm"
    uuid = "cdaa312e-45d7-49fa-b859-3cfebeff13f9"
  }

  disk_list {
    data_source_reference = {
      kind = "vm"
      name = "source-vm"
      uuid = "cdaa312e-45d7-49fa-b859-3cfebeff13f9"
    }
  }

  disk_list {
    device_properties {
      device_type = "CDROM"
      disk_address = {
        adapter_type = "SATA"
        device_index = "0"
      }
    }
  }

  disk_list {
    disk_size_mib = 10000
    device_properties {
      device_type = "DISK"
      disk_address = {
        device_index = 4
        adapter_type = "SCSI"
      }
    }
  }

  nic_list {
    subnet_uuid = data.nutanix_subnet.subnet.id
  }
}

However, the VM is deploying without any error.

Test done with the following version: Terraform provider 1.8.0 Prism Central : pc.2022.6.0.1

xerxist commented 10 months ago

This issue is still present.

Using Nutanix AHV Terraform version: v1.6.2 Nutanix provider: v1.9.3

xerxist commented 1 month ago

Still the same issue.