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?expanded=delete-a-volume-detail#delete-a-volume

Request

Parameters

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 is 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

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

Response

Status codes

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.