-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Openstack destroy order ends in error_deleting volume #8030
Comments
Thanks for reporting this.
Can you provide some more details about this? I'm not familiar with this Cinder driver. :( |
OK, so when Does Terraform report that everything succeeded? Can you provide debug output of both |
Sorry, forgot attach destroy log
|
Then volumes stuck in |
Ah, I think I see what's going on.
Terraform will destroy resources in the opposite direction of building them. Since you are creating volumes and then specifying their IDs in the instance, this is creating an implicit dependency on the volumes and instance, so first the volumes are created then the instance. When you destroy, first the instance will be destroyed and then the volumes. This seems to be fine for most Cinder drivers, but it looks like the EMC driver might want the volumes to be explicitly detached. Therefore, the Instance should explicitly detach all volumes during its destroy action. I'll look into this. Thank you for reporting it. 😄 |
Side note: does the |
Update: while EMC volume still is in attached state ( from storage side), cinder commands doesn't help either. Cinder reset-state , does what it should, but if you try to delete, you will get the same error, as volume is still physically attached, so correct order should be detach firstly. |
Understood. Thanks for the info! |
I just created #8172. Would you be able to test these changes locally and see if they fix this problem? |
Terraform v0.7.1 is destroying EMC volumes without any error. Looks like your fix is working. Thank You! |
But the fix hasn't been merged yet... |
@jtopjian looks like our cloud team applied some fix to prevent locked state. @wizardmatas ? |
Yes, we applied "sio_unmap_volume_before_deletion=True" for openstack cinder. Then this option did a trick :) |
@mvtks but this PR is about feature in terraform to do unmounts before to exclude such situations https://raymii.org/s/articles/Fix_inconsistent_Openstack_volumes_and_instances_from_Cinder_and_Nova_via_the_database.html |
Yes, they should do a fix. And we do not edit database! When volume gets "error deleting" status, we go to EMC scaleio and tell to unmap it. Then after state reset volume could be deleted. |
That's great news regarding |
The PR has been merged and will be available in 0.7.2 (or available now if you compile the master branch from source. I'm going to close this issue, but do let me know if this didn't fix the problem or if the PR actually caused more problems... Thank you for reporting this. :) |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform v0.6.14
Affected Resource(s)
Please list the resources as a list, for example:
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Debug Output
Can make later.
Expected Behavior
Actual Behavior
Steps to Reproduce
terraform apply
terraform destroy
Important Factoids
EMC scaleio backend that doesn't allow mapped volume deletion.
The text was updated successfully, but these errors were encountered: