Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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';

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

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

$volume_uuid

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

mysql> use cinder;

cinder;

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

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

='$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';

id='volume_uuid';

Step 3: Now again try deleting the effected volume

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

$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';

id='$volume_uuid';

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 ~(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
[root@controller ~(openstack_admin)]#cinder reset-state
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'
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
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 [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()
set deleted=1,status='deleted',deleted_at=now(),updated_at=now() where deleted=0 and id='$volume_uuid';