Skip to main content

Clone Vm

POST /v1/vms/{vm_id}/clone

Copy a running VM into a new, separate VM. The source is snapshotted (paused briefly, then it keeps running) and a new VM with the same size, lifetime and metadata, and a copy of its egress policy, is started from that snapshot. The clone is a second VM, billed on its own while it runs, and counts toward your VM, Devbox and snapshot limits; snapshot_deleted says whether the intermediate snapshot was removed.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
vm_idpathstringYes
waitquerybooleanNoWait for clone VM to be provisioneddefault=true
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

application/json​

Resolved schema:

{
"properties": {
"snapshot_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Snapshot Name"
}
},
"type": "object",
"title": "VMCloneRequest"
}

Field details:

FieldTypeRequiredDescriptionConstraints
snapshot_namestring | nullNonullable

Responses​

200​

Successful Response

application/json​

Resolved schema:

{
"properties": {
"vm_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Vm Id"
},
"session_id": {
"type": "string",
"title": "Session Id"
},
"status": {
"type": "string",
"title": "Status"
},
"snapshot_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Snapshot Id"
},
"snapshot_deleted": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Snapshot Deleted"
}
},
"type": "object",
"required": [
"session_id",
"status"
],
"title": "VMCloneResponse"
}

Field details:

FieldTypeRequiredDescriptionConstraints
vm_idstring | nullNonullable
session_idstringYes
statusstringYes
snapshot_idstring | nullNonullable
snapshot_deletedboolean | nullNonullable

400​

wait=false is not supported for clones, the VM has no session, or its egress policy could not be copied.

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 your account cannot start VMs yet (the body's code says why), or the VM belongs to another account.

No response body.

404​

VM not found.

No response body.

409​

The source VM is not running, is being recovered, or was killed, rebound or moved during the snapshot. Retry.

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

429​

Too many requests, or your VM, Devbox, concurrent-startup or snapshot limit is reached.

No response body.

503​

No capacity, the VM is temporarily unreachable, or the snapshot or restore failed transiently. Retry later.

No response body.