terraform-provider-vra7 icon indicating copy to clipboard operation
terraform-provider-vra7 copied to clipboard

VRA Provider deletes resources from state file before receiving any "SUCCESSFUL" status response from VRA during terraform destroy

Open soumik612 opened this issue 5 years ago • 0 comments

vRA 7.x version 7.4 Terraform version v0.12.13 terraform-provider-vra7 plugin version provider.vra7 v0.5.0

Describe the bug . Our environment has a pre approval setup where my credentials does not have rights to destroy resources directly. A destroy request needs to be approved by someone with elevated access rights. Once approved, I can see the VMs are destroyed in VRA UI. I tried to destroy two Linux VMs I created using TF. The provider sends status request to VRA periodically and receives update "Status: PENDING_PRE_APPROVAL". This continues for around 15 mins and then TF removes the resources from the state file with a message image

This is not expected behavior. I assumed that after 15mins the provider may timeout the request and stop the destroy task and maintain the state file since VRA did not delete the VMs yet.

If I check the VRA UI, then I see the destroy request is yet to be approved. Also the last status response from TF LOG file was still "Request status: PENDING_PRE_APPROVAL." image image

Expected behavior The provider should not delete the resources from state file unless it receives a "SUCCESSFUL" response from VRA. If it times out, then TF should maintain the resource state.

Desktop (please complete the following information):

  • OS: Ubuntu

Additional context Add any other context about the problem here.

soumik612 avatar Nov 12 '19 14:11 soumik612