Nutanix Cluster Information
Terraform Version
- 0.12.17
- 0.13.7
- 0.15.3
- 1.0.0
Affected Resource(s)
Terraform Configuration Files
resource "nutanix_virtual_machine" "vm" {
count = var.platform == "ahv" && local.os_short_name == "rhe" ? 1 : 0
name = infoblox_record_host.host.name
cluster_uuid = element([for c in flatten(data.nutanix_clusters.clusters[*].entities) :
c.metadata["uuid"] if c.name == var.cluster], 0)
description = var.owner != "" ? "${var.owner} - terraform - ${lookup(data.external.environment.result, "date", formatdate("YYYYMMDD", timestamp()))}" : "${lookup(data.external.environment.result, "owner", "terraform")} - terraform - ${lookup(data.external.environment.result, "date", formatdate("YYYYMMDD", timestamp()))}"
num_vcpus_per_socket = var.cpus <= local.cpu_max ? var.cpus : local.cpu_max
num_sockets = 1
memory_size_mib = var.memory <= local.memory_max ? var.memory : local.memory_max
owner_reference = {
kind = "user"
name = data.nutanix_user.user[count.index].user_name
uuid = data.nutanix_user.user[count.index].id
}
nic_list {
subnet_uuid = data.nutanix_subnet.subnet[count.index].id
}
guest_customization_cloud_init_user_data = base64encode(data.template_file.cloudinit_user_data[count.index].rendered)
disk_list {
data_source_reference = {
kind = "image"
uuid = data.nutanix_image.image[count.index].id
}
device_properties {
device_type = "DISK"
disk_address = {
adapter_type = "SCSI"
device_index = "0"
}
}
}
dynamic "disk_list" {
iterator = iii
for_each = var.additional_disks
content {
disk_size_mib = iii.value * 1000
}
}
... (provisioners only beyond this point)
}
Actual Behavior
After initial apply to create the VM, a plan would display the following:
- disk_list {
- data_source_reference = {} -> null
- disk_size_bytes = 0 -> null
- disk_size_mib = 0 -> null
- uuid = "77ebeb80-c890-4130-90fc-85c14d546819" -> null
- volume_group_reference = {} -> null
- device_properties {
- device_type = "CDROM" -> null
- disk_address = {
- "adapter_type" = "IDE"
- "device_index" = "0"
} -> null
}
}
Steps to Reproduce
- Create a
nutanix_virtual_machine resource without specifying the creation of a CDROM, but specifying guest_customization_cloud_init_user_data or guest_customization_sysprep
- After creation, run
terraform plan again
- Observe a CDROM is present, which Terraform wants to destroy
- Run
terraform apply, and observe the VM is rebooted
Important Factors
This has happened using multiple different versions of Terraform, and with provider version 1.1.1 and 1.2.0, all against AOS 5.19.*. This is not present in 5.15 LTS, and we are yet to test 5.20 LTS.
Nutanix Cluster Information
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Actual Behavior
After initial apply to create the VM, a plan would display the following:
Steps to Reproduce
nutanix_virtual_machineresource without specifying the creation of a CDROM, but specifyingguest_customization_cloud_init_user_dataorguest_customization_sysprepterraform planagainterraform apply, and observe the VM is rebootedImportant Factors
This has happened using multiple different versions of Terraform, and with provider version 1.1.1 and 1.2.0, all against AOS 5.19.*. This is not present in 5.15 LTS, and we are yet to test 5.20 LTS.