Migration Service (Plus)

The V2V Migration Service is a separate feature module. To use this feature, you need to purchase both the Base License and the Plus License of V2V Migration Service. The Plus License cannot be used independently.

Migration Service Operations

AddV2VConversionHost

API Request

URLs
POST zstack/v1/v2v-conversion-hosts
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "V2V-Converter-01",
    "description": "to convert vm from foreign hypervisor",
    "type": "VMWARE",
    "hostUuid": "fc2971a1a5943bdda6733feecfb26861",
    "storagePath": "/path/to/large/directory/"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"V2V-Converter-01","description":"to convert vm from foreign hypervisor","type":"VMWARE","hostUuid":"fc2971a1a5943bdda6733feecfb26861","storagePath":"/path/to/large/directory/"}}' http://localhost:8080/zstack/v1/v2v-conversion-hosts
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The resource name. 3.0.1
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.0.1
type String body (contained in the params structure) The type of the V2V conversion host.
  • VMWARE
3.0.1
hostUuid String body (contained in the params structure) The host UUID. 3.0.1
storagePath String body (contained in the params structure) The image storage path of the V2V migration. 3.0.1
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 3.0.1
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.4.0
systemTags List body Optional. The system tags. 3.0.1
userTags List body Optional. The user tags. 3.0.1
Note:
  • When you add a V2V conversion host in ZStack Cloud, you can specify the CIDR for the V2V migration network by adding the networkcidr option to SystemTags. The SystemTag is passed by using the networkcidr parameter.
    • Format of the networkcidr option: conversion::network::cidr::{netcidr}
    • Example: conversion::network::cidr::{10.0.0.1/24}.

API Response

Sample Response
{
  "inventory": {
    "uuid": "c6ac169863173a9bb5742974d731a242",
    "name": "V2V-Converter-01",
    "description": "to convert vm from foreign hypervisor",
    "type": "VMWARE",
    "hostUuid": "dcffe404cd0336a5817bfba0e56117ac",
    "storagePath": "/path/to/large/directory/",
    "state": "Enabled"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.0.1
inventory V2VConversionHostInventory See inventory. 3.0.1
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.0.1
description String The brief description of the error. 3.0.1
details String The details about the error. 3.0.1
elaboration String The reserved field. Default value: null. 3.0.1
opaque LinkedHashMap The reserved field. Default value: null. 3.0.1
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.0.1
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.0.1
name String The resource name. 3.0.1
description String The detailed description of the resource. 3.0.1
type String The type. 3.0.1
hostUuid String The host UUID. 3.0.1
storagePath String The image storage path of the V2V migration. 3.0.1
state String The state. 3.0.1
createDate Timestamp The creation date. 3.0.1
lastOpDate Timestamp The last operation date. 3.0.1

#

SDK Sample

Java SDK
AddV2VConversionHostAction action = new AddV2VConversionHostAction();
action.name = "V2V-Converter-01";
action.description = "to convert vm from foreign hypervisor";
action.type = "VMWARE";
action.hostUuid = "fc2971a1a5943bdda6733feecfb26861";
action.storagePath = "/path/to/large/directory/";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddV2VConversionHostAction.Result res = action.call();
Python SDK
AddV2VConversionHostAction action = AddV2VConversionHostAction()
action.name = "V2V-Converter-01"
action.description = "to convert vm from foreign hypervisor"
action.type = "VMWARE"
action.hostUuid = "fc2971a1a5943bdda6733feecfb26861"
action.storagePath = "/path/to/large/directory/"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddV2VConversionHostAction.Result res = action.call()

ChangeV2VConversionHostState

API Request

URLs
PUT zstack/v1/v2v-conversion-hosts/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeV2VConversionHostState": {
    "stateEvent": "disable"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeV2VConversionHostState":{"stateEvent":"disable"}}' http://localhost:8080/zstack/v1/v2v-conversion-hosts/99c4cb23248e37aeb54037578aaa120f/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.1
stateEvent String body (contained in the changeV2VConversionHostState structure) The state event.
  • enable
  • disable
3.0.1
systemTags List body Optional. The system tags. 3.0.1
userTags List body Optional. The user tags. 3.0.1

API Response

Sample Response
{
  "inventory": {
    "uuid": "ac5f6b519b86352faa5e1d94ad5461d8",
    "name": "new-name",
    "description": "new description",
    "type": "VMWARE",
    "hostUuid": "d5d8d26dfc913c9aa8f220a238b9e0bb",
    "storagePath": "/path/to/large/directory/",
    "state": "Disabled"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.0.1
inventory V2VConversionHostInventory See inventory. 3.0.1
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.0.1
description String The brief description of the error. 3.0.1
details String The details about the error. 3.0.1
elaboration String The reserved field. Default value: null. 3.0.1
opaque LinkedHashMap The reserved field. Default value: null. 3.0.1
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.0.1
# inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.0.1
name String The resource name. 3.0.1
description String The detailed description of the resource. 3.0.1
type String The type. 3.0.1
hostUuid String The host UUID. 3.0.1
storagePath String The image storage path of the V2V migration. 3.0.1
state String The state. 3.0.1
createDate Timestamp The creation date. 3.0.1
lastOpDate Timestamp The last operation date. 3.0.1

SDK Sample

Java SDK
ChangeV2VConversionHostStateAction action = new ChangeV2VConversionHostStateAction();
action.uuid = "99c4cb23248e37aeb54037578aaa120f";
action.stateEvent = "disable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeV2VConversionHostStateAction.Result res = action.call();
Python SDK
ChangeV2VConversionHostStateAction action = ChangeV2VConversionHostStateAction()
action.uuid = "99c4cb23248e37aeb54037578aaa120f"
action.stateEvent = "disable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeV2VConversionHostStateAction.Result res = action.call()

ConvertVmFromForeignHypervisor

API Request

URLs
POST zstack/v1/v2vs
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "url": "vmware://155cb773228d346ba8ed1135d48f3718",
    "name": "VM-1",
    "description": "vm migrated from foreign hypervisor",
    "conversionHostUuid": "30099212bdc030ad8c2d9634f8104fb0",
    "cpuNum": 1.0,
    "memorySize": 1.073741824E9,
    "clusterUuid": "336cdcfb4a3c3757b4fd77e7340ee322",
    "primaryStorageUuid": "40de3bc8e79c31cb9f052546e162524b",
    "l3NetworkUuids": [
      "5ad0b57788373ec7b805fd54246b1a33"
    ],
    "defaultL3NetworkUuid": "5ad0b57788373ec7b805fd54246b1a33",
    "platform": "Linux",
    "strategy": "InstantStart",
    "convertStrategy": "CapacityOptimized",
    "pauseVm": false
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"vmware://155cb773228d346ba8ed1135d48f3718","name":"VM-1","description":"vm migrated from foreign hypervisor","conversionHostUuid":"30099212bdc030ad8c2d9634f8104fb0","cpuNum":1.0,"memorySize":1.073741824E9,"clusterUuid":"336cdcfb4a3c3757b4fd77e7340ee322","primaryStorageUuid":"40de3bc8e79c31cb9f052546e162524b","l3NetworkUuids":["5ad0b57788373ec7b805fd54246b1a33"],"defaultL3NetworkUuid":"5ad0b57788373ec7b805fd54246b1a33","platform":"Linux","strategy":"InstantStart","convertStrategy":"CapacityOptimized","pauseVm":false}}' http://localhost:8080/zstack/v1/v2vs
Request Parameters
Name Type Location Description Optional Value Starting Version
url String body (contained in the params structure) The source VM instance URL. 3.0.1
name String body (contained in the params structure) The resource name. 3.0.1
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.0.1
conversionHostUuid String body (contained in the params structure) Optional. The V2V conversion host UUID. 3.0.1
cpuNum Integer body (contained in the params structure) The CPU count. 3.0.1
memorySize Long body (contained in the params structure) The memory size. 3.0.1
zoneUuid String body (contained in the params structure) Optional. The zone UUID. 3.0.1
clusterUuid String body (contained in the params structure) Optional. The cluster UUID. 3.0.1
hostUuid String body (contained in the params structure) Optional. The host UUID. 3.0.1
primaryStorageUuid String body (contained in the params structure) The primary storage UUID. 3.0.1
l3NetworkUuids List body (contained in the params structure) The L3 network UUID list. 3.0.1
defaultL3NetworkUuid String body (contained in the params structure) Optional. The UUID of the default L3 network. 3.0.1
platform String body (contained in the params structure) Optional. The platform.
  • Linux
  • Windows
  • WindowsVirtio
  • Paravirtualization
  • Other
3.0.1
type String body (contained in the params structure) Optional. The VM instance type.
  • UserVm
  • ApplianceVm
3.0.1
strategy String body (contained in the params structure) Optional. The V2V migration strategy, which determines whether the target VM instance will be started immediately after migration.
  • InstantStart
  • JustConvert
3.0.1
longJobName String body (contained in the params structure) Optional. The migration job name. 3.0.1
longJobDescription String body (contained in the params structure) Optional. The migration job description. 3.0.1
resourceUuid String body (contained in the params structure) Optional. The resource UUID of the V2V migration job. 3.0.1
convertStrategy String body (contained in the params structure) Optional. 3.6.0
sshPrivKey String body (contained in the params structure) Optional. The private key that is used to verify SSH login. 3.6.0
pauseVm boolean body (contained in the params structure) Optional. Whether to pause the VM instance before migration. 3.6.0
volumeFilters List body (contained in the params structure) Optional. The volume filter information. 3.6.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.6.0
systemTags List body Optional. The system tags. 3.0.1
userTags List body Optional. The user tags. 3.0.1

API Response

Sample Response
{
  "inventory": {
    "uuid": "58c143053914375e94529a5590c64f95"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.0.1
inventory LongJobInventory See inventory. 3.0.1
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.0.1
description String The detailed description of the error. 3.0.1
details String The details about the error. 3.0.1
elaboration String The reserved field. Default value: null. 3.0.1
opaque LinkedHashMap The reserved field. Default value: null. 3.0.1
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.0.1
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.0.1
name String The resource name. 3.0.1
description String The detailed description of the resource. 3.0.1
apiId String The API ID used to associate with the task progress. 3.0.1
jobName String The job name. 3.0.1
jobData String The job data. 3.0.1
jobResult String The job result. 3.0.1
targetResourceUuid String The target resource UUID. 3.0.1
managementNodeUuid String The management node UUID. 3.0.1
createDate Timestamp The creation date. 3.0.1
lastOpDate Timestamp The last operation date. 3.0.1
state LongJobState See state. 3.0.1
#state
Name Type Description Starting Version
name String The resource name. 3.0.1
ordinal int 3.0.1

SDK Sample

Java SDK
ConvertVmFromForeignHypervisorAction action = new ConvertVmFromForeignHypervisorAction();
action.url = "vmware://155cb773228d346ba8ed1135d48f3718";
action.name = "VM-1";
action.description = "vm migrated from foreign hypervisor";
action.conversionHostUuid = "30099212bdc030ad8c2d9634f8104fb0";
action.cpuNum = 1.0;
action.memorySize = 1.073741824E9;
action.clusterUuid = "336cdcfb4a3c3757b4fd77e7340ee322";
action.primaryStorageUuid = "40de3bc8e79c31cb9f052546e162524b";
action.l3NetworkUuids = asList("5ad0b57788373ec7b805fd54246b1a33");
action.defaultL3NetworkUuid = "5ad0b57788373ec7b805fd54246b1a33";
action.platform = "Linux";
action.strategy = "InstantStart";
action.convertStrategy = "CapacityOptimized";
action.pauseVm = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ConvertVmFromForeignHypervisorAction.Result res = action.call();
Python SDK
ConvertVmFromForeignHypervisorAction action = ConvertVmFromForeignHypervisorAction()
action.url = "vmware://155cb773228d346ba8ed1135d48f3718"
action.name = "VM-1"
action.description = "vm migrated from foreign hypervisor"
action.conversionHostUuid = "30099212bdc030ad8c2d9634f8104fb0"
action.cpuNum = 1.0
action.memorySize = 1.073741824E9
action.clusterUuid = "336cdcfb4a3c3757b4fd77e7340ee322"
action.primaryStorageUuid = "40de3bc8e79c31cb9f052546e162524b"
action.l3NetworkUuids = [5ad0b57788373ec7b805fd54246b1a33]
action.defaultL3NetworkUuid = "5ad0b57788373ec7b805fd54246b1a33"
action.platform = "Linux"
action.strategy = "InstantStart"
action.convertStrategy = "CapacityOptimized"
action.pauseVm = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ConvertVmFromForeignHypervisorAction.Result res = action.call()

DeleteV2VConversionHost

API Request

URLs
DELETE zstack/v1/v2v-conversion-hosts/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/v2v-conversion-hosts/5392899dcf7d351eab91ceeb6d38d4e5?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.1
deleteMode String url Optional. The delete mode. 3.0.1
systemTags List body Optional. The system tags. 3.0.1
userTags List body Optional. The user tags. 3.0.1

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
DeleteV2VConversionHostAction action = new DeleteV2VConversionHostAction();
action.uuid = "5392899dcf7d351eab91ceeb6d38d4e5";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteV2VConversionHostAction.Result res = action.call();
Python SDK
DeleteV2VConversionHostAction action = DeleteV2VConversionHostAction()
action.uuid = "5392899dcf7d351eab91ceeb6d38d4e5"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteV2VConversionHostAction.Result res = action.call()

QueryV2VConversionHost

API Request

URLs
GET zstack/v1/v2v-conversion-hosts
GET zstack/v1/v2v-conversion-hosts/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/v2v-conversion-hosts?q=uuid=4fb0bf1bce02350a9a19277897bc0595
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/v2v-conversion-hosts/beb30505a0b434b68c1b68565290ebcf

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryV2VConversionHost, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "91f0ea12823a39dea9db5d1cab133e3f",
      "name": "V2V-Converter-01",
      "description": "to convert vm from foreign hypervisor",
      "type": "VMWARE",
      "hostUuid": "f773c300a8343774bc45e0ea3980d6da",
      "storagePath": "/path/to/large/directory/",
      "state": "Enabled"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.0.1
inventories List See inventories. 3.0.1
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.0.1
description String The brief description of the error. 3.0.1
details String The details about the error. 3.0.1
elaboration String The reserved field. Default value: null. 3.0.1
opaque LinkedHashMap The reserved field. Default value: null. 3.0.1
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.0.1
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 3.0.1
name String The resource name. 3.0.1
description String The detailed description of the resource. 3.0.1
type String The type. 3.0.1
hostUuid String The host UUID. 3.0.1
storagePath String The image storage path of the V2V migration. 3.0.1
state String The state. 3.0.1
createDate Timestamp The creation date. 3.0.1
lastOpDate Timestamp The last operation date. 3.0.1

SDK Sample

Java SDK
QueryV2VConversionHostAction action = new QueryV2VConversionHostAction();
action.conditions = asList("uuid=fbc030b04f5f3249bb1e6dad82489102");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryV2VConversionHostAction.Result res = action.call();
Python SDK
QueryV2VConversionHostAction action = QueryV2VConversionHostAction()
action.conditions = ["uuid=7e845caa39013c19b3c4ea9630bdfef1"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryV2VConversionHostAction.Result res = action.call()

UpdateV2VConversionHost

API Request

URLs
PUT zstack/v1/v2v-conversion-hosts/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateV2VConversionHost": {
    "name": "new-name",
    "description": "new description",
    "storagePath": "/path/to/new/large/directory/"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateV2VConversionHost":{"name":"new-name","description":"new description","storagePath":"/path/to/new/large/directory/"}}' http://localhost:8080/zstack/v1/v2v-conversion-hosts/077ec852bf603aa7b2ad7159e7707251/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.1
name String body (contained in the updateV2VConversionHost structure) Optional. The resource name. 3.0.1
description String body (contained in the updateV2VConversionHost structure) Optional. The detailed description of the resource. 3.0.1
storagePath String body (contained in the updateV2VConversionHost structure) Optional. The image storage path of the V2V migration. 3.0.1
systemTags List body Optional. The system tags. 3.0.1
userTags List body Optional. The user tags. 3.0.1

API Response

Sample Response
{
  "inventory": {
    "uuid": "fae22298c74b381b9dc0abcb02e7a3d7",
    "name": "new-name",
    "description": "new description",
    "type": "VMWARE",
    "hostUuid": "fd0aa0e947d535f4985fd4fef8b309e7",
    "storagePath": "/path/to/large/directory/",
    "state": "Enabled"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.0.1
inventory V2VConversionHostInventory See inventory. 3.0.1
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.0.1
description String The brief description of the error. 3.0.1
details String The details about the error. 3.0.1
elaboration String The reserved field. Default value: null. 3.0.1
opaque LinkedHashMap The reserved field. Default value: null. 3.0.1
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.0.1
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.0.1
name String The resource name. 3.0.1
description String The detailed description of the resource. 3.0.1
type String The type. 3.0.1
hostUuid String The host UUID. 3.0.1
storagePath String The image storage path of the V2V migration. 3.0.1
state String The state. 3.0.1
createDate Timestamp The creation date. 3.0.1
lastOpDate Timestamp The last operation date. 3.0.1

SDK Sample

Java SDK
UpdateV2VConversionHostAction action = new UpdateV2VConversionHostAction();
action.uuid = "077ec852bf603aa7b2ad7159e7707251";
action.name = "new-name";
action.description = "new description";
action.storagePath = "/path/to/new/large/directory/";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateV2VConversionHostAction.Result res = action.call();
Python SDK
UpdateV2VConversionHostAction action = UpdateV2VConversionHostAction()
action.uuid = "077ec852bf603aa7b2ad7159e7707251"
action.name = "new-name"
action.description = "new description"
action.storagePath = "/path/to/new/large/directory/"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateV2VConversionHostAction.Result res = action.call()
API Reference | 4.8.38 | ZStack Cloud · ZCF | ZStack Resource Center