Skip to main content

Update VM Configuration

PUT/v2.1/servers/{server_id}

Updates the editable attributes of a VM. Capacity changes such as vCPUs and RAM are not made here; use the resize action instead.

info

Request​

Parameters​

server_idstringrequiredpath

The UUID of the VM.

serverobjectrequiredbody

Server wrapper.

5 fields
namestringbody

New VM name.

descriptionstringbody

Free-form description, up to 255 characters.

accessIPv4stringbody

IPv4 address that should be used to access this VM.

accessIPv6stringbody

IPv6 address that should be used to access this VM.

OS-DCF:diskConfigstringbody

AUTO or MANUAL. Applies when the disk is partitioned on create, rebuild, or resize.

Sample Request​

curl -ks -X PUT -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
-d '{
"server": {
"name": "vm1-renamed"
}
}' https://api.vietnix.cloud:8774/v2.1/servers/{server_id}

Response​

Sample Response​

Response body
{
"server": {
"id": "642b7726-bc3b-4824-872b-124097d2d20c",
"name": "vm1-renamed",
"links": [
{
"rel": "self",
"href": "https://api.vietnix.cloud:8774/v2.1/servers/642b7726-bc3b-4824-872b-124097d2d20c"
},
{
"rel": "bookmark",
"href": "https://api.vietnix.cloud:8774/servers/642b7726-bc3b-4824-872b-124097d2d20c"
}
]
}
}

Status Code​

Success​

Status CodeDescription
200 - OKThe VM was updated.

Error​

Status CodeDescription
400 - Bad RequestSome content in the request was invalid, for example a description longer than 255 characters.
401 - UnauthorizedUser must authenticate before making a request.
403 - ForbiddenPolicy does not allow current user to do this operation.
404 - Not FoundThe VM does not exist, or is not visible to your project.
409 - ConflictThe VM is in a status that does not allow this change.
note

Change one attribute at a time when you script this call. Renaming a VM does not change its hostname inside the guest, and it does not affect the IDs used by other endpoints.