Skip to main content

Virtual Machine Migration

Migrate a virtual machine to another node.

Request

POST /api/v1/pve/vm/:clusterId/:node/:vmid/migrate
Authorization: Bearer <token>
Content-Type: application/json

Path Parameters

ParameterTypeDescription
clusterIdintCluster ID
nodestringSource node name
vmidintVirtual machine ID

Request Body

{
"target": "pve-node-02",
"online": true,
"withLocalDisks": false
}

Request Parameters

ParameterTypeDescription
targetstringTarget node name
onlineboolWhether to migrate online (default: true)
withLocalDisksboolWhether to migrate local disks (default: false)

Response

{
"code": 200,
"message": "success",
"data": {
"taskId": "UPID:pve-node-01:00001234:5678ABCD:90EF1234:migrate:100:root@pam:"
}
}

Migration Status

You can query migration status via task API:

GET /api/v1/pve/task/:taskId
Authorization: Bearer <token>