Deleting a Virtual Machine (VM)
To delete a virtual machine (VM), you can send a DELETE request to the /v2.1/servers/{server_id} endpoint of the compute service, replacing {server_id} with the actual ID of the VM you want to delete. This request requires an authentication token, which you should include in the request headers.
warning
Deleting a VM is a permanent action and cannot be undone. Ensure that you have backed up any important data before proceeding with the deletion.
info
For more details on deleting VMs with additional parameters, refer to the Virtuozzo Document.
Request
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| server_id | path | string | The UUID of the server. |
Sample Request
Using curl
curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://api.vietnix.cloud:8774/v2.1/servers/{server_id}
Using HTTP request
DELETE https://api.vietnix.cloud:8774/v2.1/servers/{server_id}
Response
Status Code
Success
| Status Code | Description |
|---|---|
| 204 - No Content | The server has fulfilled the request. |
Error
| Status Code | Description |
|---|---|
| 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. |