13.11. Detaching volumes from virtual machines¶
DELETE /servers/{server_id}/os-volume_attachments/{volume_id}
Detach a volume from the given virtual machine.
Note
This is an asynchronous API, callers should poll the status and list of volume attachments within the volume API, to determine when the detachment has completed successfully.
Source: https://docs.openstack.org/api-ref/compute/?expanded=detach-a-volume-from-an-instance-detail
13.11.1. Request¶
Name | In | Type | Description |
---|---|---|---|
server_id |
path | string | The UUID of the server. |
volume_id |
path | string | The UUID of the volume to detach. |
13.11.1.1. Examples¶
Detach a volume with the specified ID from a VM with the specified ID.
# curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:8774/v2.1/b906404c55bb44729da99987536ac5bc/servers/0785ee80-1eca-426b-b8c4-5b499fc7f614/os-volume_attachments/16cd801e-f3c1-4cac-aa6c-aecf22642a89
13.11.2. Response¶
13.11.2.1. Status codes¶
13.11.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. |
13.11.2.1.2. Error¶
Code | Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
409 - Conflict |
This operation conflicted with another operation on this resource. |
Version 5.0.0 — Feb 01, 2022