Cannot delete a cinder volume although the instance is deleted in Red Hat OpenStack Platform

Solution Verified - Updated -

Issue

A cinder volume cannot be deleted. It lists itself as attached to an instance, but the instance does not exist.

[root@ctr1 cinder(keystone_admin)]# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable |             Attached to              |
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+
| 4327bc98-026d-4566-a9b9-df02ff5df554 | available |              |  20  |     None    |   true   | a43554df-967c-4db5-afa6-812e56048d95 |
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+

[root@ctr1 cinder(keystone_admin)]# cinder  delete 4327bc98-026d-4566-a9b9-df02ff5df554
Delete for volume 4327bc98-026d-4566-a9b9-df02ff5df554 failed: Volume 4327bc98-026d-4566-a9b9-df02ff5df554 is still attached, detach volume first. (HTTP 400) (Request-ID: req-19cd1916-7583-497b-b8ec-4139dfd11dc8)
ERROR: Unable to delete any of the specified volumes.
[root@ctr1 cinder(keystone_admin)]# cinder  force-delete 4327bc98-026d-4566-a9b9-df02ff5df554
Delete for volume 4327bc98-026d-4566-a9b9-df02ff5df554 failed: Volume 4327bc98-026d-4566-a9b9-df02ff5df554 is still attached, detach volume first. (HTTP 400) (Request-ID: req-4773a999-0376-46ac-a364-b48b48c1d01b)
ERROR: Unable to force delete any of the specified volumes.
[root@ctr1 cinder(keystone_admin)]# cinder  reset-state 4327bc98-026d-4566-a9b9-df02ff5df554
[root@ctr1 cinder(keystone_admin)]# cinder  delete 4327bc98-026d-4566-a9b9-df02ff5df554
Delete for volume 4327bc98-026d-4566-a9b9-df02ff5df554 failed: Volume 4327bc98-026d-4566-a9b9-df02ff5df554 is still attached, detach volume first. (HTTP 400) (Request-ID: req-ee62a45d-4c69-4ee7-b2ce-3a52efaf994f)
ERROR: Unable to delete any of the specified volumes.
[root@ctr1 cinder(keystone_admin)]# cinder  force-delete 4327bc98-026d-4566-a9b9-df02ff5df554
Delete for volume 4327bc98-026d-4566-a9b9-df02ff5df554 failed: Volume 4327bc98-026d-4566-a9b9-df02ff5df554 is still attached, detach volume first. (HTTP 400) (Request-ID: req-bdaa24c3-5da8-40fb-aa50-523a51030498)
ERROR: Unable to force delete any of the specified volumes.
[root@ctr1 cinder(keystone_admin)]# nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

With the openstack client, the error message looks like this:

(overcloud) [stack@director ~]$ openstack volume delete <vol>
Failed to delete volume with name or ID '<vol>': Invalid volume: Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots or be disassociated from snapshots after volume transfer. (HTTP 400) (Request-ID: <req>)

Environment

Red Hat OpenStack Platform

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In