Creating a Migration Task
Function
This API is used to create a migration task based on a source server.
URI
POST /v1/sms/tasks
Request
Request parameters
For details about the request parameters, see Table 1.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Specifies the task name (user-defined). The parameter value consists of 4 to 64 characters, including letters, digits, underscores (_), hyphens (-), periods (.). |
type |
Yes |
String |
Specifies the task type.
|
os_type |
Yes |
String |
Specifies the OS type. The value can only be WINDOWS or LINUX. |
priority |
No |
int |
Specifies the process priority.
|
speed_limit |
No |
int |
Specifies the migration rate limit (in MB). The default value is 0, indicating that the migration rate is not limited. |
start_target_server |
No |
Boolean |
Specifies whether to start the target ECS after the migration.
|
uninstall_agent |
No |
Boolean |
Specifies whether to automatically uninstall the migration Agent on the source server.
|
source_server |
Yes |
JSON |
Specifies the source server information. For details, see Table 2. |
target_server |
Yes |
JSON |
Specifies the target ECS information. For details, see Table 3. |
migration_ip |
Yes |
String |
Specifies the IP address of the target ECS.
|
region_name |
Yes |
String |
Specifies the region name of the target ECS. |
region_id |
Yes |
String |
Specifies the region ID of the target ECS. |
project_name |
Yes |
String |
Specifies the name of the project which the target ECS belongs to. |
project_id |
Yes |
String |
Specifies the ID of the project which the target ECS belongs to. For details, see Obtaining a Project ID. |
vm_template_id |
No |
String |
Specifies the template ID. |
smn_info |
No |
JSON |
Specifies the SMN service information. For details, see Table 8. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
Yes |
String |
Specifies the source server ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
vm_id |
Yes |
String |
Specifies the target ECS ID. |
name |
Mandatory under certain conditions |
String |
Specifies the name of the target ECS.
NOTE:
|
disks |
Mandatory under certain conditions |
JSON array |
Specifies the disk information. For details, see Table 6.
NOTE:
|
btrfs_list |
Yes |
JSON array |
Specifies the Btrfs information. For details, see Table 4. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Specifies the file system name, for example, /dev/vdb1. |
label |
String |
Specifies the file system tag. If no tag exists, the value is an empty string. |
uuid |
String |
Specifies the UUID of the file system. |
device |
String |
Specifies the device name in the Btrfs. |
default_subvolid |
String |
Specifies the default ID of the subvolume. |
default_subvol_name |
String |
Specifies the default name of the subvolume. |
default_subvol_mountpath |
String |
Specifies the default mount path of the subvolume. |
subvolumn |
JSON array |
Specifies the subvolume information. For details, see Table 5. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
uuid |
Yes |
String |
Specifies the UUID of the parent volume of the subvolume. |
is_snapshot |
Yes |
String |
Specifies whether the subvolume is a snapshot. |
subvol_id |
Yes |
String |
Specifies the subvolume ID. |
parent_id |
Yes |
String |
Specifies the ID of the parent volume of the subvolume. |
subvol_name |
Yes |
String |
Specifies the subvolume name. |
subvol_mount_path |
Yes |
String |
Specifies the mount path of the subvolume. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Specifies the disk name. |
disk_id |
Yes |
String |
Specifies the ID of the EVS volume corresponding to the disk. |
size |
Yes |
long |
Specifies the disk size. |
physical_volumes |
Yes |
JSON array |
Specifies the partition information after the disk is migrated. For details, see Table 7. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Specifies the partition name.
|
size |
Yes |
long |
Specifies the partition size (byte). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
topic_urn |
Yes |
String |
Specifies the topic URN. |
trigger_conditions |
Yes |
String |
Specifies the triggering condition for sending SMN messages. The value can be SUCCESS,FAIL, SUCCESS, or FAIL. |
language |
Yes |
String |
Specifies the Language option. |
topic_name |
Yes |
String |
Specifies the topic name. |
Example
- Example request
- Creating a task to migrate a source server that runs a Windows OS
{ "name": "Windows Migration", "type": "MIGRATE_BLOCK", "priority": "1", "speed_limit": "0", "start_target_server": "true", "os_type": "WINDOWS", "migration_ip":"x.x.x.x", "region_name":"UAE-Abu Dhabi", "region_id":"ae-ad-1", "region_name":""UAE-Abu Dhabi", "project_id":"12222222111111121212121", "vm_template_id":"aaaa-bbbbb", "source_server":{ "id":"35ef9d7a-b8e4-4126-9588-116952749de4" }, "target_server": { "vm_id": "e198f4cc-e51a-43df-83d8-79bd41e00bed", "disks": [ { "name": "Disk 0", "disk_id":"e198f4cc-e51a-43df-1234-79bd41e00bed", "size": "85897247744", "physical_volumes": [ { "name": "(Reserved)", "size": "104857088" }, { "name": "C:\\", "size": "85792390656" } ] }, { "name": "Disk 1", "disk_id":"e198f4cc-1234-43df-1234-79bd41e00bed", "size": "214745218048", "physical_volumes": [ { "name": "D:\\", "size": "109888667136" }, { "name": "F:\\", "size": "104856550912" } ] } ] } }
- Creating a task to migrate a source server that runs a Linux OS
- Creating a task to migrate a source server that runs a Windows OS
- Example response
{ "id": "170606111111" }
Status Codes
See Status Codes.
Error Codes
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot