Detaching volumes from virtual machines
DELETE /servers/{server_id}/os-volume_attachments/{volume_id}
Detach a volume from the given virtual machine.
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.
Request
Parameters
| Name | In | Type | Description |
|---|---|---|---|
server_id
|
path | string | The UUID of the server. |
volume_id
|
path | string | The UUID of the volume to detach. |
Example
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
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. |
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. |