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
Source: update-server
Request
Parameters
server_idstringrequiredpathThe UUID of the VM.
serverobjectrequiredbodyServer wrapper.
5 fields
namestringbodyNew VM name.
descriptionstringbodyFree-form description, up to 255 characters.
accessIPv4stringbodyIPv4 address that should be used to access this VM.
accessIPv6stringbodyIPv6 address that should be used to access this VM.
OS-DCF:diskConfigstringbodyAUTO 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 Code | Description |
|---|---|
| 200 - OK | The VM was updated. |
Error
| Status Code | Description |
|---|---|
| 400 - Bad Request | Some content in the request was invalid, for example a description longer than 255 characters. |
| 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 VM does not exist, or is not visible to your project. |
| 409 - Conflict | The 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.