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
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.0.0
Terraform Provider
v2.8.2
VMware vSphere
7
Description
When using the vsphere_virtual_machine resource in Terraform to manage VMs with multiple disks, removing a disk from the configuration leads to errors if the deleted disk remains in the state file as <deleted>. This results in Terraform attempting to manage an additional, non-existent disk, causing the error:
Error: disk.2: cannot find disk device: invalid ID
Re-run terraform plan or terraform apply, and Terraform will throw an error similar to:
Error: disk.1: cannot find disk device: invalid ID
Debug Output
N/A
Panic Output
N/A
Expected Behavior
Terraform should ignore any deleted disk entries in the state file, refraining from managing these resources or generating invalid ID errors.
Actual Behavior
Terraform interprets disks in the state file as existing resources, causing it to search for invalid disk IDs that no longer exist in the configuration. This leads to an invalid ID error, blocking any further plan or apply operations.
Steps to Reproduce
Configure a vsphere_virtual_machine resource in Terraform with two disks.
Delete one disk from the configuration but leave its entry in the state file (marked as <deleted>).
Run terraform plan or terraform apply.
Observe Terraform attempting to manage a non-existent disk (e.g., disk.2), which triggers the error.
Environment Details
No response
Screenshots
No response
References
No response
The text was updated successfully, but these errors were encountered:
hi @burnsjared0415 - my apologies for my delay in response here. I asked the field team member to confirm with the customer they are using v7 or v8. Will response once I hear back. I would assume they are using v7.
Community Guidelines
Terraform
v1.0.0
Terraform Provider
v2.8.2
VMware vSphere
7
Description
When using the vsphere_virtual_machine resource in Terraform to manage VMs with multiple disks, removing a disk from the configuration leads to errors if the deleted disk remains in the state file as
<deleted>
. This results in Terraform attempting to manage an additional, non-existent disk, causing the error:Error: disk.2: cannot find disk device: invalid ID
Affected Resources or Data Sources
vsphere_virtual_machine
Terraform Configuration
Initial Configuration with Two Disks
Debug Output
N/A
Panic Output
N/A
Expected Behavior
Terraform should ignore any deleted disk entries in the state file, refraining from managing these resources or generating invalid ID errors.
Actual Behavior
Terraform interprets disks in the state file as existing resources, causing it to search for invalid disk IDs that no longer exist in the configuration. This leads to an invalid ID error, blocking any further plan or apply operations.
Steps to Reproduce
vsphere_virtual_machine
resource in Terraform with two disks.<deleted>
).terraform plan
orterraform apply
.disk.2
), which triggers the error.Environment Details
No response
Screenshots
No response
References
No response
The text was updated successfully, but these errors were encountered: