-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to destroy VM during first terraform destroy run: unexpected state 'RUNNING', wanted target 'DONE' #132
Comments
Added some more Debug output to module. The following values are evaluated: |
Hi @meise , Thank you for your issue. In the attached file I cannot see all the attempts while the default value for timeout is 3 minutes. It looks like the VM is still active after the Thanks |
Thank you @jaypif for your quick response. The destroy fails after 10 seconds. Maybe our cluster is just slower, compared to other users of the provider. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days |
I reproduced the problem in delaying the terminate action (I put it in a goroutine that start with a big sleep of 10 sec minimum). At first glance, in the implementation of
From the doc: From here, I tried to add However, it's a quick fix so I'll still need to investigate more to propose something better. |
Error Description
In my terraform/OpenNebula combination it's not possible to destroy an opennebula_virtual_machine during first
terraform destroy
run. Terraform always fails with error message:Error: Error waiting for virtual machine (546) to be in state DONE: unexpected state 'RUNNING', wanted target 'DONE'. last error: %!s(<nil>) (state: ACTIVE, lcmState: RUNNING)
. I have to runterraform destroy
multiple times to delete all VM resources.Code snippets
As far as I can understand the code, after reaching the 10s destroying wait delay, its expected to retry
waitForVMState
.terraform-provider-opennebula/opennebula/resource_opennebula_virtual_machine.go
Line 998 in 2017157
But in my case,
vmState == vm.Active && vmLcmState == vm.EpilogFailure
is always false.terraform-provider-opennebula/opennebula/resource_opennebula_virtual_machine.go
Line 1004 in 2017157
Versions
Resource
Error message
Log
destroying_vm.log
The text was updated successfully, but these errors were encountered: