Description
Community Guidelines
- I have read and agree to the HashiCorp Community Guidelines .
- Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
- Do not leave "+1" or other comments that do not add relevant information or questions.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Terraform
v1.11.2
Terraform Provider
2.11.1
VMware vSphere
8.0.3.00400 (Not sure how to find this, this is reported to be the vSphere Client version)
Description
When running terraform apply on a non-trivial stack which, amongst others, provisions multiple VMs and creates two new datastores, the single VM that uses the newly provisioned datastores errors out with the following message which is just one example, it actually errors out with similar messages on all 6 disk resources that use the two newly created datastores:
Error: Provider produced inconsistent final plan
When expanding the plan for module.solution["solution"].module.product["product"].vsphere_virtual_machine.db_vm["db_vm_uuid"] to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/vsphere" produced an invalid new value for .disk[4].datastore_id: was cty.StringVal("<computed>"), but now cty.StringVal("datastore-176385").
This is a bug in the provider, which should be reported in the provider's own issue tracker.
Affected Resources or Data Sources
resource/vsphere_virtual_machine
Terraform Configuration
The configuration is too complex to whittle down to a single/simple example. Because I am opening this issue so that I can open a PR against it, I hope skipping this is okay.
Debug Output
https://gist.github.com/mbokman/d023aefb6e70b3c230476e901f05f886
Panic Output
No response
Expected Behavior
The module.solution["solution"].module.product["product"].vsphere_virtual_machine.db_vm["db_template"]
resource is provisioned successfully. It certainly does when I just run another terraform apply after erroring out on the first try.
Actual Behavior
Error: Provider produced inconsistent final plan
When expanding the plan for module.solution["solution"].module.product["product"].vsphere_virtual_machine.db_vm["db_vm_uuid"] to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/vsphere" produced an invalid new value for .disk[4].datastore_id: was cty.StringVal("<computed>"), but now cty.StringVal("datastore-176385").
This is a bug in the provider, which should be reported in the provider's own issue tracker.
Steps to Reproduce
As mentioned before, this is tricky, since I am not able to provide a single/simple setup to mirror my setup.
Environment Details
The storage for the backend is provisioned in the same terraform apply, it is provisioned on an IBM FlexArray using REST API calls using the "magodo/restful" provider. The volume provisioning is successful, the vsphere_vmfs_datastore is successful too and the VM that is failing has an explicit dependency set on the datastore(s).
Screenshots
No response
References
No response