How To Delete Volume From Database In Openstack
Cinder Volume deletion is possible using simple commands, incase volume is not able to delete even force remove we have to work database backend.
Here simple steps to remove Cinder Volume from CLI,
Before start the below steps follow the few changes in cinder.conf. Make debug=True and verbose=True and restart the cinder services.After the follow the next steps,
1.Get the Cinder list use the follow,
#openstack volume list (or) #cinder list
2.From the above command get the volume id which need to remove from the volume list,
#openstack volume delete <volumeid> (or) cinder delete <volumeid>
3.Now recheck the volume has been removed or not,
#openstack volume list (or) #cinder list
If Cinder volume is still exist we have to remove the volume from backend database,
1.Before login to the database get the volume id details,
#cinder list
2.Now check the cinder volume status which is in error_deleting or Detaching and reset to available state,
#cinder reset-state –state available <volumeid>
3.Login to mysql database and use cinder database,
#mysql>use cinder;
4.set the cinder volume state available,
#mysql>update volumes set attach_status=’detached’,status=’available’ where id ='<volumeid’;
5.Comeout from mysql prompt and try to delete the volume using volume id,
#cinder delete <volumeid>
6.If the above step did not work to delete the volume again login to the mysql and use the cinder database.And follow the below command,
#mysql>update volumes set deleted=1,status=’deleted’,deleted_at=now(),updated_at=now() where deleted=0 and id='<volumeid>’;
Tags:cinder,Cinder services,Cinder volume,cinder backup,cinder storage,cinder snapshot,nova list,nova services,mytecharticle,technews,openstack,keystone endpoints,glance list,nova image list,cinder volume issue
Worked using the last step. My volume was orphaned because the storage was backend was removed.