-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Failed to destroy AWS node with volume: * aws_volume_attachment.jenkins_disk_attachment: Error waiting for Volume (vol-XXXX) to detach from Instance: i-XXXXX #1991
Comments
@evgeniagusakova You might want to try setting #1017 would be worth a look. |
I am facing the same problem and it does help to set |
I had similar issue with destroying aws_ebs_volume attached to instance.
So I tried to detach a mounted volume from instance manually and after a while it failed with a note:
Which in code looks like this:
So the idea is to free the volume before it gets detached. |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @evgeniagusakova as hashicorp/terraform#16167. It was migrated here as a result of the provider split. The original body of the issue is below.
Hi Team!
I faced with issue when I'm not able to destroy instance with volume created by terraform
Terraform Version
Issue Explanation
I created instance and attached pre-created volume with the following code:
(all code not related to issue like sec. groups, EIP etc are skipped)
And got an error when I tried to do
terraform destroy
Debug Output
Expected Behavior
Instance is deleted, volume is deattached but not deleted.
Actual Behavior
EIP is deattached
Sec. Groups are not deleted
Instance is not deleted
Volume is not deattaced
Workaround
on node:
lsof
helps to find all processes)terraform state rm aws_volume_attachment.jenkins_disk_attachment
terraform destroy -var ....
Additional details
I'm really sure that disk was not de-attached because it was mounted and in-use. From Amazon Console I was able to deattach it only after I did disk unmount.
But I expected Forced deattach from terraform after some (configurable?) timeout.
So if this is expected behaviour I guess we need to convert this bug report into feature request :)
References
Not sure but this issue looks close to my.
It was with old terraform version so I decided to create new issue.
The text was updated successfully, but these errors were encountered: