Open jtognazzi opened 2 days ago
Hello, jtognazzi! 🖐
Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.
If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.
Community Guidelines
Terraform
1.9.8
Terraform Provider
2.10.0
VMware vSphere
8.0.3
Description
When Creating a VM with 1 or multiple disks you can properly use the disk uuid in other resources or in locals variables. the value is only known after apply, but it works properly.
Now, if you add some other disks on a VM which already exists, it does not work anymore as the disk uuid is not shown as known after apply, and if you have resources relying on it it fails because it is null.
Affected Resources or Data Sources
resource/vsphere_virtual_machine
Terraform Configuration
Debug Output
https://gist.github.com/jtognazzi/10f79a78405566dc1512e7a620e4b505
Panic Output
No response
Expected Behavior
The uuid of all attached disk should be shown in output and
Actual Behavior
It fails with the following error
terraform apply -var 'datadisks=["disk1"]'
Edit: I added the terraform_data resource and now the error is
Steps to Reproduce
var.datadisks
is an empty list per default. So runningterraform apply
will create a new VM with only 1 disk attached then runningterraform apply -var 'datadisks=["disk1"]'
will attach another disk to the VM, but it fails.If I destroy everything and run directly the same command (so the VM has 2 disks attached), it works properly.
Environment Details
No response
Screenshots
No response
References
No response