Skip to main content

Update Vm

PATCH /v1/vms/{vm_id}

Change a running VM: memory, vCPU count, egress policy, vault bindings, and what happens when it ends (snapshot_on_terminate, snapshot_name, auto_suspend, auto_resume). A vCPU change is applied first and the call waits for it; vCPUs can grow only back up to the count the running VM started with. Memory and egress changes are applied in the background and may take effect after the response.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
vm_idpathstringYes
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

application/json​

Resolved schema:

{
"properties": {
"memory_mb": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Memory Mb"
},
"vcpu_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Vcpu Count"
},
"egress_policy": {
"anyOf": [
{
"type": "object"
},
{
"type": "null"
}
],
"title": "Egress Policy"
},
"snapshot_on_terminate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Snapshot On Terminate"
},
"snapshot_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Snapshot Name"
},
"auto_suspend": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Auto Suspend"
},
"auto_resume": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Auto Resume"
},
"vault_ids": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Vault Ids"
}
},
"type": "object",
"title": "VMUpdateRequest"
}

Field details:

FieldTypeRequiredDescriptionConstraints
memory_mbinteger | nullNonullable
vcpu_countinteger | nullNonullable
egress_policyobject | nullNonullable
snapshot_on_terminateboolean | nullNonullable
snapshot_namestring | nullNonullable
auto_suspendboolean | nullNonullable
auto_resumeboolean | nullNonullable
vault_idsarray<string> | nullNonullable
vault_ids[]stringNo

Responses​

200​

Successful Response

application/json​

Resolved schema:

{}

400​

Invalid memory, vCPU count or egress policy.

No response body.

401​

No credentials, or the Bearer token / X-API-Key is invalid.

No response body.

403​

The account is disabled, or a guest token was used; or the VM belongs to another account, your plan does not allow that vCPU count, or a vault is not yours.

No response body.

404​

VM not found.

No response body.

409​

The VM is not running, or the vCPU change was refused (above the VM's maximum, or a snapshot is in progress).

No response body.

422​

Validation Error

application/json​

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo

503​

The VM is temporarily unreachable, or the vCPU change failed and was not applied.

No response body.

504​

The VM did not answer in time; the vCPU change may still apply.

No response body.