Open fad3t opened 2 months ago
It is because it always implicitly adds a cdrom drive at index 0. It would be better if that was handled in the api call, rather than the tf config so that it becomes part of the state. Or atleast, if you could actually use ignore_changes
on the disk_list...
lifecycle {
ignore_changes = [
guest_customization_cloud_init_user_data,
disk_list,
disk_list[0],
disk_list[1],
STILL gives:
~ update in-place
Terraform will perform the following actions:
# nutanix_virtual_machine.windows[2] will be updated in-place
~ resource "nutanix_virtual_machine" "windows" {
id = "blabla"
name = "k8swindows3"
# (35 unchanged attributes hidden)
- disk_list {
- data_source_reference = {} -> null
- disk_size_bytes = 389120 -> null
- disk_size_mib = 1 -> null
- uuid = "xxx" -> null
- volume_group_reference = {} -> null
- device_properties {
- device_type = "CDROM" -> null
- disk_address = {
- "adapter_type" = "IDE"
- "device_index" = "0"
} -> null
}
- storage_config {
- storage_container_reference {
- kind = "storage_container" -> null
- name = "SelfServiceContainer" -> null
- uuid = "xxx" -> null
}
}
}
Nutanix Cluster Information
Prism Central pc.2024.1.0.2 Cluster 6.5.4.5 LTS
Terraform Version
Terraform v1.5.7
Affected Resource(s)
Description
We have an existing VM that has been deployed using Terraform. When doing a plan, Terraform reports changes on disks. It looks like it's changing the disk order, which shouldn't be happening. Is there a clean way to manage VMs with multiple disks?
Terraform Configuration Files
This is a subset, as the
nutanix_virtual_machine
is embedded into a custom module.Module code:
VM instance:
Debug Output
Expected Behavior
No change.
Actual Behavior
The plan reports changes in disk layout. All disks seem to be mixed up.