Skip to main content

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

NameInTypeDescription
server_idpathstringThe 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 CodeDescription
204 - No ContentThe server has fulfilled the request.

Error

Status CodeDescription
401Unauthorized — User must authenticate before making a request.
403Forbidden — Policy does not allow current user to do this operation.
404Not Found — The requested resource could not be found.
409Conflict — This operation conflicted with another operation on this resource.