Ask Your Question
1

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

1 answer

Sort by ยป oldest newest most voted
10

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

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

Seen: 16,125 times

Last updated: May 15 '15