Open ianc769 opened 2 months ago
Hello, ianc769! 🖐
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.
Workaround:
vsphere_virtual_machine
terraform apply
terraform state rm
on objects (They actually delete from vSphere.)Have you tried setting the api_timeout
for the provider?
provider "vsphere" {
user = var.vsphere_user
password = var.vsphere_password
vsphere_server = var.vsphere_server
allow_unverified_ssl = true
api_timeout = 10
}
This will override the default timeout.
Ryan Johnson Distinguished Engineer, VMware by Broadcom
Hey @tenthirtyam Does this affect the resource itself? I see that the default is 5
minutes according to the docs https://registry.terraform.io/providers/hashicorp/vsphere/latest/docs#api_timeout
Fully deleting the datastore takes about 1 minute it looks like.
I can try the build/destroy again with it doubled to 10
minutes, but I suspect it will not work.
I upped the timeout via ENV Var. VSPHERE_API_TIMEOUT=10
. Sadly looks like the provider is faster than vSphere.
The datastores do actually delete.
Current work around is to run the destroy, clean up the state objects that are listed as failed, then run the apply again.
Also noticing similar behaviour regardless of destroying a VM when deleting multiple datastores.
In our case, we are attempting to destroy 8 datastores and receive a timeout on any that are not deleted within 30 seconds or 1 minute and 5 seconds (we've seen both, however it is now only 30 seconds). Workaround mentioned here is the same as we've found works ourselves, however as we're using pipelines triggered by users unfamiliar with Terraform this wouldn't work as the timeout would cause the pipeline to consider itself failed.
Behaviour is noticeable even on relatively small, unused datastores (50-100GB).
Changing the API Timeout seems to have no effect on this.
Terraform 1.8.5
Terraform Provider 2.8.3 & 2.9.2
VMware vSphere 8.0.2.00300
Community Guidelines
Terraform
1.8.5
Terraform Provider
2.8.2
VMware vSphere
8.0.2.00300
Description
Possibly related #417
Deleting vms that have larger disks, In our case 600GBx2, the operation times out since vSphere takes longer than 30s to delete them.
Perhaps having a customizable wait timer would be a good route for this resource, as vSphere seems to be a little iffy on timing.
Affected Resources or Data Sources
resources/vsphere_vmfs_datastore
Possibly this code:
https://github.com/hashicorp/terraform-provider-vsphere/blob/0a41cd630a3c308f789249ddc97f2653c8fd66e2/vsphere/resource_vsphere_vmfs_datastore.go#L407-L415
Terraform Configuration
Debug Output
https://gist.github.com/ianc769/b6fa08135736fa5db09ff49e5c85bd11
Panic Output
No response
Expected Behavior
Full Deletion with no issues.
Actual Behavior
Error Presenting if we hit the 30s mark.
Steps to Reproduce
Add a VM with a few large disks. Then delete them via Terraform.
Environment Details
No response
Screenshots
References
417