Ask Your Question

How to delete volume with available status and attached to

asked 2015-05-15 03:26:44 -0500

xiangfeiz gravatar image

Somehow I got a large number of cinder volumes in available status but have an instance ID in its "attached to". The instance of the instance ID has been deleted in nova. I know this is a bug to enter that state. But with it, how can I delete the volume in this state? By the way, I have tried 'force-delete' and that does not allow me to delete it.

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted

answered 2015-05-15 04:25:11 -0500

sunnyarora gravatar image

updated 2015-05-15 07:38:28 -0500

So, there is a workaround for doing this via mysql db, but i would not recommend directly to make changes in DB. But that works.

Step 1: Get volume uuid by running cinder list command

 [root@controller ~(openstack_admin)]#cinder list

Step2: You can check the available status and try to reset the state of volume, if that shows "Error_deleting" or "Detaching" Then you can reset-state of the volume from

[root@controller ~(openstack_admin)]#cinder reset-state --state available $volume_uuid

If that also fails, Login to mysql db and use cinder DB

mysql> use cinder;

-following cinder mysql query sets the Cinder state to available:

mysql>update volumes set attach_status='detached',status='available' where id ='$volume_uuid';

or you can also specify more options like setting up instance uuid to NULL and attach time to NULL.

mysql>update volumes set attach_status='detached',instance_uuid=NULL,attach_time=NULL,status="available" WHERE id='volume_uuid';

Step 3: Now again try deleting the effected volume

[root@controller~(openstack_admin)]#cinder delete $volume_uuid

Step 4: if the above workflow dont help then below mysql query will delete the volume

mysql>update volumes set deleted=1,status='deleted',deleted_at=now(),updated_at=now() where deleted=0 and id='$volume_uuid';
edit flag offensive delete link more


Thank you!! this was useful.

TijoV gravatar imageTijoV ( 2018-02-07 03:06:20 -0500 )edit

In addition to this I;d add following 2 mysql requests:

[cinder]> delete from volume_admin_metadata where volume_id = '$volume_uuid';
[cinder]> delete from volume_attachment where volume_id = '$volume_uuid';
noonedeadpunk gravatar imagenoonedeadpunk ( 2019-05-08 12:31:44 -0500 )edit

answered 2018-08-27 01:38:35 -0500

Arvindr226 gravatar image

Hi, We don't need to update the mysql database table. We can do as below steps.

Step 1: Make sure that you are admin

# source keystone_admin

Step 2-: Get the UUID of the of the volume you need to remove

# cinder list --all

Step 3-: Reset the state to available

# cinder reset-state --state available <UUID>

Step 4-: detached the volume

# cinder reset-state --attach-status detached <UUID>

Step 5-: Delete the volume now

# cinder delete <UUID>
edit flag offensive delete link more


Hope this is fixed now in 2018, way back in 2015 the steps given by you were not working and thats why we adopted the workaround. -Thanks

sunnyarora gravatar imagesunnyarora ( 2018-10-05 04:36:32 -0500 )edit

I can confirm this does work on a stack running Queens. Thank you for this, was happy to not have to go into the DB.

jim-golden gravatar imagejim-golden ( 2019-05-29 11:17:26 -0500 )edit

answered 2018-02-16 10:04:29 -0500

mriedem gravatar image

Resetting the volume state won't remove any orphaned attachment records for the volume. It's better to use the force detach API (defaults to admin-only):

Unfortunately there are no CLIs for this in python-cinderclient or python-openstackclient yet.

edit flag offensive delete link more


I was able to use the API successfully using CURL!

zioproto gravatar imagezioproto ( 2018-05-25 06:44:00 -0500 )edit


Can you share the curl procedure? For some reason my cinder refuses to respond properly to curl, and I cannot sort out why ...

laszlo-budai gravatar imagelaszlo-budai ( 2018-09-07 10:56:48 -0500 )edit

answered 2018-09-02 09:27:36 -0500

I've made a script to do so. (

chmod +x

./ ip username password

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2015-05-15 03:26:44 -0500

Seen: 56,420 times

Last updated: Sep 02 '18