Cinder volume attached to a terminated server ... now I can't delete it.

asked 2017-02-25 22:35:50 -0600

DrEdWilliams gravatar image

I was debugging a Heat stack that (among other things) attached an existing Cinder Volume to a new instance created by the stack. The instance died, but the attachment still exists. Now I can't delete the Attachment, or the volume, or the Heat stack that created the attachment! I was hoping that it would time out or possibly get cleaned up automatically as I was working with other volumes, but it has been 28 hours since the attachment was created and it is still hanging on.

I'm using OpenStack Newton. How can I clean up this dangling attachment?

edit retag flag offensive close merge delete


What error message are you getting?

zaneb gravatar imagezaneb ( 2017-02-27 09:30:01 -0600 )edit

When I try to delete the volume from the command line, I get:

"Failed to delete volume with name or ID 'XXXXXXX': Invalid volume: Volume status must be available or error or error_restoring or error_extending and must not be migrating, attached, belong to a group or have snapshots."

DrEdWilliams gravatar imageDrEdWilliams ( 2017-02-27 18:59:17 -0600 )edit

In Horizon, it doesn't show the volume in the list, but shows an error popup saying: "Failed to get attachment information".

DrEdWilliams gravatar imageDrEdWilliams ( 2017-02-27 19:02:00 -0600 )edit

The Heat stack error message is: "Delete_Failed: Resource DELETE failed: Unauthorized: resources.workspace_attach: The request you have made requires authentication. " ... but when I try to delete the attachment with "openstack server remove volume", it can't find the server (obviously).

DrEdWilliams gravatar imageDrEdWilliams ( 2017-02-27 19:06:34 -0600 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2017-02-28 21:37:21 -0600

DrEdWilliams gravatar image

I finally found the right incantation:

cinder reset-state --attach-status detached <volume>
cinder delete <volume>

I remembered that the dedicated component CLI commands frequently have more capability than the common 'openstack' command ... and in this case it has the option to remove the attachment information. After that, deleting went as expected -- and the stack deleted as well.

Maybe that functionality could be added to the common 'openstack' command?

Thanks for your assistance, zaneb!

edit flag offensive delete link more

answered 2017-02-28 10:53:42 -0600

zaneb gravatar image

I think an admin can clean this up using openstack volume set --state error <volume>.

If you can't delete it from Cinder then you won't be able to delete it from Heat. If you can get it deleted from Cinder then Heat should then do the Right Thing and just ignore it when you delete the stack (raise a bug if not).

edit flag offensive delete link more


I can set the state to error, but it still won't let me delete the volume -- I get the same error message because it is still attached.

DrEdWilliams gravatar imageDrEdWilliams ( 2017-02-28 21:15:30 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-02-25 22:35:50 -0600

Seen: 6,665 times

Last updated: Feb 28 '17