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
| Name | In | Type | Required | Description | Constraints |
|---|---|---|---|---|---|
vm_id | path | string | Yes | ||
wait | query | boolean | No | Wait for clone VM to be provisioned | default=true |
X-API-Key | header | string | null | No | nullable |
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
snapshot_name | string | null | No | nullable |
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
vm_id | string | null | No | nullable | |
session_id | string | Yes | ||
status | string | Yes | ||
snapshot_id | string | null | No | nullable | |
snapshot_deleted | boolean | null | No | nullable |
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
detail | array<object> | No | ||
detail[] | object | No | ||
detail[].loc | array<string | integer> | No | ||
detail[].loc[] | string | integer | No | ||
detail[].msg | string | No | ||
detail[].type | string | No |
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.