7.6. Deleting volumes¶
DELETE /v3/{project_id}/volumes/{volume_id}
Delete a volume with the specified ID.
Preconditions:
- Volume status must be
available
,in-use
,error
,error_restoring
,error_extending
,error_managing
, and must not be migrating, attached, belong to a group or have snapshots. - You cannot already have a snapshot of the volume.
- You cannot delete a volume that is in a migration.
Asynchronous postconditions:
- The volume is deleted in volume index.
- The volume managed by OpenStack Block Storage is deleted in storage node.
Troubleshooting:
- If volume status remains in
deleting
or becomeserror_deleting
the request failed. Ensure you meet the preconditions then investigate the storage back end. - The volume managed by OpenStack Block Storage is not deleted from the storage system.
Source: https://docs.openstack.org/api-ref/block-storage/v3/index.html#delete-a-volume
7.6.1. Request¶
Name | In | Type | Description |
---|---|---|---|
project_id |
path | string | The UUID of the project in a multi-tenancy cloud. |
volume_id |
path | string | The UUID of the volume. |
cascade (Optional) |
query | boolean | Remove any snapshots along with the volume. Default=False. |
force (Optional) |
query | boolean | Indicates whether to force delete a volume even if
the volume is in deleting or error_deleting. Default is New in version 3.23 |
7.6.1.1. Example¶
# curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:8776/v3/f5d834d636c642c7bfe8af86139c6f26/volumes/de5b7dfc-e3e8-4f14-9969-98d61af40329
Version 5.0.0 — Feb 01, 2022