To remove an orphaned volume form an openstack deployment
mysql>delete from volume_admin_metadata where volume_id='9eb308c2-8f2f-4361-b9a2-fd320e11f8ac'; mysql>delete from volumes where id='17035b2d-0496-48b8-bce0-b2418b13b0a2'; # or a snapshot mysql>delete from snapshot where id='17035b2d-0496-48b8-bce0-b2418b13b0a2';
<3>How to remove and old / unused volume group
select * from services; select * from services; +---------------------+---------------------+------------+---------+----+-----------------+------------------+------------------+--------------+----------+-------------------+-----------------+ | created_at | updated_at | deleted_at | deleted | id | host | binary | topic | report_count | disabled | availability_zone | disabled_reason | +---------------------+---------------------+------------+---------+----+-----------------+------------------+------------------+--------------+----------+-------------------+-----------------+ | 2015-11-18 20:06:36 | 2015-11-19 20:45:19 | NULL | 0 | 1 | os1 | cinder-scheduler | cinder-scheduler | 8807 | 0 | nova | NULL | | 2015-11-18 21:58:11 | 2015-11-19 19:53:53 | NULL | 0 | 2 | os2 | cinder-volume | cinder-volume | 6762 | 0 | nova | NULL | | 2015-11-19 17:26:53 | 2015-11-19 19:55:29 | NULL | 0 | 3 | os1 | cinder-volume | cinder-volume | 878 | 0 | nova | NULL | | 2015-11-19 20:00:36 | 2015-11-19 20:04:46 | NULL | 0 | 4 | os1@zfssa | cinder-volume | cinder-volume | 25 | 0 | nova | NULL | | 2015-11-19 20:06:27 | 2015-11-19 20:45:11 | NULL | 0 | 5 | os1@zfssa-2 | cinder-volume | cinder-volume | 183 | 0 | nova | NULL | +---------------------+---------------------+------------+---------+----+-----------------+------------------+------------------+--------------+----------+-------------------+-----------------+
Delete old unused volume group
mysql> delete from services where id='4'; Query OK, 1 row affected (0.00 sec)