Closed ssteine2 closed 4 years ago
@ssteine2 Thanks for raising this, this is a known issue on Cloud side, it cannot ensure the device name correct. As a workaround, you can make the compute_volume_attach_v2 resource depend on the previous compute_volume_atatch_v2 to keep the device order.
Seems not to be an issue of the provider @ssteine2 Please comment if you still need the issue
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Manually simplified excerpt (hopefully without typos ;) ):
Actual Behavior
I create multiple blockstorage volumes ("disks") for each instance. The disks are then attached to the instance. This works well on the first run, creating a proper terraform state.
That is, the device property in the terraform statefile is equal to the device name on the ecs instance.
The problem starts when I rebuild the instance by recycling the root volume and then re-attaching the existing disks to it. The device property will then in some cases (exact conditions unknown) no longer match with the naming found on the instance.
That is, the terraform state still reports the device as "/dev/vdc", "/dev/vdd" while in fact it's named "/dev/vde", "/dev/vdf" on the OS. Rerunning
terraform apply
again does not change this invalid state.My automation code is thus not able to properly mount the volumes because it retrieves the wrong device names from the terraform state.
Expected Behavior
The device property of opentelekomcloud_compute_volume_attach_v2 should always correctly reflect the device name as used on the ecs.
Steps to Reproduce
terraform apply
a project which contains an ecs instance with multiple (non-ephemeral) disks attachedAs mentioned above this does not always happen and I was not able to pinpoint the exact circumstances under which this shows up. Maybe a certain degree of parallelism is required (say e.g. 10 instances with 10 attached non-ephemeral disks each)