Closed C-F-A closed 3 months ago
Hi, Thanks for submitting this issue. The order of execution is defined by Terraform, since every disk is a separate resource, and both have the same dependencies.
You can affect such behavior by adding a dependency of your own. For example, if you want vm1_disk1
to be processed before vm1_disk2
, you can change the definition as follows:
resource "vcd_vm_internal_disk" "vm1_disk1" {
vapp_name = vcd_vapp.APP1.name
vm_name = vcd_vapp_vm.vm1.name
bus_type = "paravirtual"
size_in_mb = "57344"
bus_number = 0
unit_number = 0
}
resource "vcd_vm_internal_disk" "vm1_disk2" {
vapp_name = vcd_vapp.APP1.name
vm_name = vcd_vapp_vm.vm1.name
bus_type = "paravirtual"
size_in_mb = "46080"
bus_number = 1
unit_number = 1
depends_on = [vcd_vm_internal_disk.vm1_disk1] # <<<<<<-----------
}
Now that disk2 depends on disk1, disk1 will be created first. HTH
Using depends_on works for me.
Hello,
When creating Internel Disks the order of creation seems to be random and it cannot be ensured that the order of disks happens in as defined in the TF files. Is it somehow possible to ensure a defined ordering ot the internal disks?
Terraform Version
Terraform v1.4.6
Affected Resource(s)
vcd_vm_internal_disk
Terraform Configuration Files
Expected Behavior
In vCloud Director the Disks are sorted by the Index (and this is important to our installation scripts in the VM itself). The Discs should be created in order as defined in .TF file: vm1_disk1 having Index 0 vm1_disk2 having Index 1 after creation.
Actual Behavior
Disk creation seems to happen randomly or parallell and it is not ensured that first defined disk gets Index 0 assigned. Result was in some VM's (others were correct): vm1_disk2 having Index 0 vm1_disk1 having Index 1
Steps to Reproduce
terraform apply