OpenStack Volume Deletion Fails

Problem

Deletion of the volume fails with the following error.

Delete for volume 90ff151f-9d24-4db3-bc38-54a3fa37440a failed: 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-c337cb57-2259-4084-840d-aca5ccf0c260)
ERROR: Unable to delete any of the specified volumes.

Environment

Platform9 Managed OpenStack - v3.6.0 and Higher
Cinder

Cause

Volume status is stuck in “deleting” state and properties indicate that the attached mode is read-write (attached_mode=‘rw’).

# openstack volume show 90ff151f-9d24-4db3-bc38-54a3fa37440a --fit-width
+--------------------------------+----------------------------------------------------------------------------+
| Field | Value |
+--------------------------------+----------------------------------------------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2019-06-27T17:21:21.000000 |
| description | migration src for aaa0a79b-6c92-4041-8a49-85e26e9d8327 |
| encrypted | False |
| id | 90ff151f-9d24-4db3-bc38-54a3fa37440a |
| migration_status | deleting |
| multiattach | False |
| name | pdc-v-cinder2 |
| os-vol-host-attr:host | 9bfb1d8b-2a10-4b87-9c30-638922ffb082@netapp_standard#10.81.85.20:/cinder02 |
| os-vol-mig-status-attr:migstat | deleting |
| os-vol-mig-status-attr:name_id | aaa0a79b-6c92-4041-8a49-85e26e9d8327 |
| os-vol-tenant-attr:tenant_id | 0c3c9f76be7c4b08b86313c4f5b745e4 |
| properties | attached_mode='rw', readonly='False' |
| replication_status | None |
| size | 6500 |
| snapshot_id | None |
| source_volid | None |
| status | deleting |
| type | netapp_standard |
| updated_at | 2019-07-12T08:02:07.000000 |
| user_id | 9edbdc789b264150a111b732a307f37f |
+--------------------------------+----------------------------------------------------------------------------+
  • Volume deletion fails and below messages are reported in /var/log/cinder/cinder-api.log.

    817 2613 INFO cinder.volume.api [req-c337cb57-2259-4084-840d-aca5ccf0c260 f9949675c46849c69722fdb7084313a3 c8c4539df0254fd8af2b02de140d5d89 - default default] 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.2019-07-12 08:06:47.818 2613 INFO cinder.api.openstack.wsgi [req-c337cb57-2259-4084-840d-aca5ccf0c260 f9949675c46849c69722fdb7084313a3 c8c4539df0254fd8af2b02de140d5d89 - default default] http://127.0.0.1:8776/v3/c8c4539df0254fd8af2b02de140d5d89/volumes/90ff151f-9d24-4db3-bc38-54a3fa37440a returned with HTTP 400
    819 2613 INFO eventlet.wsgi.server [req-c337cb57-2259-4084-840d-aca5ccf0c260 f9949675c46

Resolution

  1. Set the state of the volume to “available”.

    # cinder reset-state --state available 90ff151f-9d24-4db3-bc38-54a3fa37440a

  2. Reset the migration status of the volume.

    # cinder reset-state --reset-migration-status 90ff151f-9d24-4db3-bc38-54a3fa37440a

  3. Set the attach status to “detached”.

    # cinder reset-state --attach-status detached 90ff151f-9d24-4db3-bc38-54a3fa37440a

  4. Delete the volume.

    # cinder delete 90ff151f-9d24-4db3-bc38-54a3fa37440a