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

nutanix_virtual_machine_v2 fails to add additional disk #750

Open
dk-d-n opened this issue Feb 18, 2025 · 0 comments
Open

nutanix_virtual_machine_v2 fails to add additional disk #750

dk-d-n opened this issue Feb 18, 2025 · 0 comments

Comments

@dk-d-n
Copy link

dk-d-n commented Feb 18, 2025

Nutanix Cluster Information

  • Nutanix Cluster (Prism Element / AOS): AOS 6.10
  • Nutanix Prism Central: pc.2024.3

Terraform Version

Terraform v0.15.5
provider registry.terraform.io/nutanix/nutanix v2.0.0

Affected Resource(s)

  • nutanix_virtual_machine_v2

Terraform Configuration Files

resource "nutanix_virtual_machine_v2" "vm" {
  name                 = "test-vm"
  num_cores_per_socket = 4
  num_sockets          = 1
  memory_size_bytes    = 8000000000
  cluster {
    ext_id = data.nutanix_cluster.cluster.id
  }

  disks {
    disk_address {
      bus_type = "SCSI"
      index = 0
    }
    backing_info {
      vm_disk {
        disk_size_bytes = 40000000000 
        data_source {
          reference {
            image_reference {
              image_ext_id = data.nutanix_image.linux_image.id
            }
          }
        }
      }
    }
  }

  dynamic "disks" {
    for_each = {for i, disk in var.disks : i => disk}
    content {
      disk_address {
        bus_type = "SCSI"
        index = disks.key + 1
      }
      backing_info {
        vm_disk {
          disk_size_bytes = disks.value * 1024 * 1024 * 1024
          storage_container {
            ext_id = data.nutanix_storage_containers_v2.storage_containers.storage_containers[0].container_ext_id
          }
        }
      }
    }
  }

  nics {
    network_info {
      nic_type = "NORMAL_NIC"
      subnet {
        ext_id = data.nutanix_subnet.subnet.id
      }
      vlan_mode = "ACCESS"
    }
  }
}

Expected Behavior

Adding a new disk should work.

Actual Behavior

Error: error waiting for disk (ZXJnb24=:02bed492-4ab9-5cf2-a44b-516c9bf0d481) to be updated: error_detail: Failed to perform the operation on the VM with UUID '5d448a19-5281-4c98-6ba6-dcc7fe26b2de' because specifying both 'dataSource' and 'diskSizeBytes' is not allowed., progress_message: 100

Steps to Reproduce

  1. Create a virtual machine using the configuration above
  2. Add a disk by setting var.disks to a non-empty list: [40]
  3. terraform apply

Important Factors

This will work if I create the additional disks right from the beginning. Adding a disk will fail.

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

No branches or pull requests

1 participant