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 becomes error_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 false.

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

7.6.2. Response

7.6.2.1. Status codes

7.6.2.1.1. Success

Code Reason
202 - Accepted Request was accepted for processing, but the processing has not been completed. A ‘location’ header is included in the response which contains a link to check the progress of the request.