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

Unable to add a second NIC to an existing VM #651

Open
Golgautier opened this issue Nov 24, 2023 · 1 comment
Open

Unable to add a second NIC to an existing VM #651

Golgautier opened this issue Nov 24, 2023 · 1 comment
Labels

Comments

@Golgautier
Copy link

I created a VM with TF. This VM got a unique NIC on Primary network. Then I added a NIC in the TF file. It failed during apply.

Nutanix Cluster Information

  • Nutanix Cluster (Prism Element / AOS) : 6.7
  • Nutanix Prism Central : PC.2023.3

Terraform Version

  • terraform v1.5.7
  • TF Plugin : 1.9.4

Affected Resource(s)

  • nutanix_vm

Terraform Configuration Files

data "nutanix_image" "image" {
  image_name = var.nutanix_image
}

data "nutanix_subnet" "subnet" {
  subnet_name = "Primary"
}

data "nutanix_subnet" "subnet2" {
  subnet_name = "Secondary"
}


resource "nutanix_virtual_machine" "bastion" {
  name = "test-gautier"
  boot_type = "UEFI"
  cluster_uuid = "xxx"

  guest_customization_cloud_init_user_data = base64encode(file("./cloud-init/simple.yaml"))

  disk_list {
    disk_size_mib = 50000
    data_source_reference = {
      kind = "image"
      uuid = data.nutanix_image.image.id
    }
  }

  disk_list {
    disk_size_mib = 10000
    device_properties {
      device_type = "DISK"
      disk_address = {
        "adapter_type" = "SCSI"
        "device_index" = "1" # /dev/sdb
      }
    }
  }

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

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


  num_vcpus_per_socket = "4"
  num_sockets = "1"
  memory_size_mib = "8192"

  lifecycle {
      ignore_changes = [
          guest_customization_cloud_init_user_data,
          cluster_uuid,
          disk_list["data_source_reference"]
      ]
  }
}

Debug Output

See attached file
tf.log

Expected Behavior

Add the new NIC

Actual Behavior

Crash

Steps to Reproduce

Deploy VM with only one nic_list then add the second one and apply it again

  1. terraform apply

Important Factors

N/A

References

N/A

@Golgautier
Copy link
Author

Note : I tried terraform 1.6.4 and behaviour is the same.

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

No branches or pull requests

2 participants