Resource Center/Resource Pool/VM Instance Operations
PUTVM Instance OperationsSince 0.6SynchronousAuth Required
MigrateVm
MigrateVm
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Path Parameters
Request Inputs
Path Parameters
vmInstanceUuidStringRequiredThe VM instance UUID.
Body Fields
migratevmObjectRequiredmigratevm request body object.
hostUuidStringOptional. The host UUID.
migrateFromDestinationBooleanOptional. Initiates the migration command from the destination host.
allowUnknownbooleanOptional. Whether allow VM instances whose state is unknown.
strategyStringOptional.
downTimeIntegerOptional. The VM down time during the hot migration.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
PUT/zstack/v1/vm-instances/{vmInstanceUuid}/actions
/zstack/v1/vm-instances/{vmInstanceUuid}/actions
Request Example
curl -X PUT 'http://{host}/zstack/v1/vm-instances/{vmInstanceUuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"migratevm":{"hostUuid":"<hostUuid>","migrateFromDestination":true,"allowUnknown":true,"strategy":"<strategy>","downTime":1},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "1124f021672c3de9848fa567b632a6bb", "name": "Test-VM", "description": "web server VM", "zoneUuid": "fdfd5d0dfdc936e284792eabf72c52db", "clusterUuid": "f42a18b125ba3d61bae560bccec84741", "imageUuid": "5e6155ea150b31bc8f7789acf9f42b12", "hostUuid": "d51ee2645a3130ffb294a0c28a121c5c", "lastHostUuid": "9d32be2f483b3995bff142d072fb410a", "instanceOfferingUuid": "07d4a48c8cd5365992c6916b07f770ef", "rootVolumeUuid": "4172134623e6332fbb9092cd105bde77", "platform": "Linux", "defaultL3NetworkUuid": "4f49dce686663b81b7d8acbe75a879ac", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8589934592, "cpuNum": 1, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM", "state": "Running", "vmNics": [ { "uuid": "f5231a1c912e3a6592f1816b5812b660", "vmInstanceUuid": "1124f021672c3de9848fa567b632a6bb", "usedIpUuid": "c9f0e849407f3f5d86376560e00f31ae", "l3NetworkUuid": "4f49dce686663b81b7d8acbe75a879ac", "ip": "192.168.1.10", "mac": "00:0c:29:bd:99:fc", "hypervisorType": "KVM", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "deviceId": 0, "state": "enable", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ], "allVolumes": [ { "uuid": "4172134623e6332fbb9092cd105bde77", "name": "Root-Volume-For-VM-1124f021672c3de9848fa567b632a6bb", "primaryStorageUuid": "fe9f085199453903b09c5de54b6d194e", "vmInstanceUuid": "1124f021672c3de9848fa567b632a6bb", "diskOfferingUuid": "66805a23b6e3362d9527f3f4dcfe4402", "rootImageUuid": "5e6155ea150b31bc8f7789acf9f42b12", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-4172134623e6332fbb9092cd105bde77/4172134623e6332fbb9092cd105bde77.qcow2", "type": "Root", "format": "qcow2", "size": 107374182400, "actualSize": 21474836480, "deviceId": 0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ] } }Change History
This API has no change history records yet.
