-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
Nutanix Cluster Information
PC/PE: 7.3
Terraform Version
1.12
Affected Resource(s)
- nutanix_volume_group_vm_v2
- nutanix_virtual_machine
- nutanix_virtual_machine_v2
Terraform Configuration Files
resource "nutanix_volume_group_v2" "volume_group" {
name = "vg-${random_pet.vg-name.id}"
should_load_balance_vm_attachments = false
sharing_status = "SHARED"
cluster_reference = local.cluster_extId
is_hidden = false
}
resource "nutanix_volume_group_disk_v2" "volume_group_disk" {
volume_group_ext_id = nutanix_volume_group_v2.volume_group.ext_id
index = 1
disk_size_bytes = provider::units::from_gb(2)
disk_data_source_reference {
ext_id = data.nutanix_storage_containers_v2.storage_container_ext_id.storage_containers[0].ext_id
entity_type = "STORAGE_CONTAINER"
}
lifecycle {
ignore_changes = [
disk_data_source_reference
]
}
}
resource nutanix_virtual_machine {
# Any VM configuration
}
resource "nutanix_volume_group_vm_v2" "vg_vm_attachment" {
volume_group_ext_id = nutanix_volume_group_v2.volume_group.ext_id
vm_ext_id = module.vm.vm.id
}Expected Behavior
A virtual machine and volume group are deployed and the volume group is attached to the virtual machine
Actual Behavior
A virtual machine and volume group are depoyed and attached, but on subsequent Terraform plan and apply actions, Terraform attempts to remove the volume group from the VM because the resulting disk was not part of the initial VM configuration.
Steps to Reproduce
terraform apply
Important Factors
This can be worked around by specifying the volume group directly on a nutanix_virtual_machine_v2 and avoiding nutanix_volume_group_vm_v2, however there does not appear to be a workaround for nutanix_virtual_machine.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels