Skip to main content
Resource Center/Hardware/Primary Storage Operations
PUTPrimary Storage OperationsSince 3.1.0SynchronousAuth Required

PrimaryStorageMigrateVm

PrimaryStorageMigrateVm

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • vmInstanceUuidStringRequired

    The VM instance UUID.

Body Fields

  • primarystoragemigratevmObjectRequired

    primarystoragemigratevm request body object.

    • dstPrimaryStorageUuidStringRequired

      The UUID of the destination primary storage.

    • withDataVolumesboolean

      Optional. Migrates the VM instance with its data volumes.

    • withSnapshotsboolean

      Optional. Migrates the VM instance with its snapshots.

    • dstHostUuidString

      Optional.

    • strategyString

      处理策略。

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

  • migratevmObjectRequired

    migratevm request body object.

    • downTimeInteger

      Optional. The VM down time during the hot migration.

    • bandwidthlong

      Optional. The bandwidth of migration across primary storage, in the unit of MB/s

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The detailed description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventoryVmInstanceInventoryRequired

    See inventory.

Endpoint

PUT/zstack/v1/vm-instances/{vmInstanceUuid}/actions

/zstack/v1/vm-instances/{vmInstanceUuid}/actions

Operation ID

PrimaryStorageMigrateVm

Permalink

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 '{"primarystoragemigratevm":{"dstPrimaryStorageUuid":"<dstPrimaryStorageUuid>","withDataVolumes":true,"withSnapshots":true,"dstHostUuid":"<dstHostUuid>","strategy":"<strategy>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"],"migratevm":{"downTime":1,"bandwidth":1}}'

Response Example

200
{ "inventory": { "uuid": "f483af349d39312c8078d142c40fb721", "name": "Test-VM", "description": "web server VM", "zoneUuid": "b7280443258337bb9e8d2abf4a014644", "clusterUuid": "a2c0ace5be2d35b5a365067a0127b377", "imageUuid": "14fb13b692e837dfa31d75ffc02d4d4d", "hostUuid": "f0690203b1463867bcb2f5a48a1fa91a", "lastHostUuid": "655acef664af39e9b6b7fec0d4de56c0", "instanceOfferingUuid": "772a66f21ef23ba7a69ad292e4489ebb", "rootVolumeUuid": "65b10a950f1336f48b770f98b25176eb", "platform": "Linux", "defaultL3NetworkUuid": "80c8af5ff0a135e18a3e7a4d2223ebd2", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8589934592, "cpuNum": 1, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 9:20:57 AM", "lastOpDate": "Nov 14, 2017 9:20:57 AM", "state": "Running", "vmNics": [ { "uuid": "b16455db309330289acb58edbfabd4b7", "vmInstanceUuid": "f483af349d39312c8078d142c40fb721", "usedIpUuid": "27787a727c143a7aada42e6c3b111887", "l3NetworkUuid": "80c8af5ff0a135e18a3e7a4d2223ebd2", "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 9:20:57 AM", "lastOpDate": "Nov 14, 2017 9:20:57 AM" } ], "allVolumes": [ { "uuid": "65b10a950f1336f48b770f98b25176eb", "name": "Root-Volume-For-VM-f483af349d39312c8078d142c40fb721", "primaryStorageUuid": "55245463f914331c954909475279c3b0", "vmInstanceUuid": "f483af349d39312c8078d142c40fb721", "diskOfferingUuid": "b2cb37282f5034fb808dff68dc18db9e", "rootImageUuid": "14fb13b692e837dfa31d75ffc02d4d4d", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-65b10a950f1336f48b770f98b25176eb/65b10a950f1336f48b770f98b25176eb.qcow2", "type": "Root", "format": "qcow2", "size": 107374182400, "actualSize": 21474836480, "deviceId": 0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 9:20:57 AM", "lastOpDate": "Nov 14, 2017 9:20:57 AM" }, { "uuid": "97bf368f3bde3490b0c08d37ac8bc747", "name": "Data-Volume-For-VM-f483af349d39312c8078d142c40fb721", "primaryStorageUuid": "4df2eddd6ac1307ebbff27d0044f72e9", "vmInstanceUuid": "f483af349d39312c8078d142c40fb721", "diskOfferingUuid": "06ea8f5a59843b8aa4d18d9c6d2b7a1d", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-97bf368f3bde3490b0c08d37ac8bc747/97bf368f3bde3490b0c08d37ac8bc747.qcow2", "type": "Data", "format": "qcow2", "size": 536870912000, "actualSize": 107374182400, "deviceId": 1, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 9:20:57 AM", "lastOpDate": "Nov 14, 2017 9:20:57 AM" } ] } }

Change History

This API has no change history records yet.

View all change history