You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This resulted in all our disks after the OS-Disk to be named disk1, disk2, etc - this is the recommended disk naming scheme according to the documentation.
Turns out that when you restore a VM from backup or revert from a snapshot, vSphere defaults to setting the labels like "Hard disk 1" , "Hard disk 2", ... Since label is an immutable attribute, Terraform will destroy the disk and create a new one upon the next plan/apply.
The documentation should be changed to reflect this.
Community Guidelines
Terraform
v1.8.2
Terraform Provider
v2.7.0
VMware vSphere
v7.0.3
Description
We've created a module for rolling out our VMs and we had used the following logic..
This resulted in all our disks after the OS-Disk to be named disk1, disk2, etc - this is the recommended disk naming scheme according to the documentation.
Turns out that when you restore a VM from backup or revert from a snapshot, vSphere defaults to setting the labels like "Hard disk 1" , "Hard disk 2", ... Since label is an immutable attribute, Terraform will destroy the disk and create a new one upon the next plan/apply.
The documentation should be changed to reflect this.
Affected Resources or Data Sources
resource/vsphere_virtual_machine
Terraform Configuration
In our tfvars file, the data_disks block looks like
Debug Output
https://gist.github.com/mvandriessen/4cdd48205c44ee8dcf05283ede551d67
Panic Output
No response
Expected Behavior
We expect labels to follow the naming convention as outlined in the documentation (disk0, disk1, disk2), in all scenarios.
Actual Behavior
Upon snapshot revert or backup restore, all hard disks receive the label "Hard disk 1", "Hard disk 2", ...
Steps to Reproduce
Environment Details
No response
Screenshots
No response
References
No response
The text was updated successfully, but these errors were encountered: