Creating a Migration Task
Function
This API is used to create a migration task for a source server.
URI
POST /v3/tasks
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). Minimum length: 1 character Maximum length: 16,384 characters |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Specifies the task name. Minimum length: 0 characters Maximum length: 255 characters |
type |
Yes |
String |
Specifies the task type. The value can be:
|
start_target_server |
No |
Boolean |
Specifies whether to start the target server after the migration. Default value: true |
os_type |
Yes |
String |
Specifies the OS type. Minimum length: 0 characters Maximum length: 255 characters |
source_server |
Yes |
SourceServerByTask object |
Specifies the source server information. |
target_server |
Yes |
TargetServerByTask object |
Specifies the target server information. |
migration_ip |
No |
String |
Specifies the IP address used for migration. This parameter is not required if the target server is automatically created. Minimum length: 0 characters Maximum length: 255 characters |
region_name |
Yes |
String |
Specifies the region name. Minimum length: 0 characters Maximum length: 255 characters |
region_id |
Yes |
String |
region id Minimum length: 0 characters Maximum length: 255 characters |
project_name |
Yes |
String |
Specifies the project name. Minimum length: 0 characters Maximum length: 255 characters |
project_id |
Yes |
String |
Specifies the project ID. Minimum length: 0 characters Maximum length: 255 characters |
vm_template_id |
No |
String |
Specifies the template used to create the target server automatically. Minimum length: 0 characters Maximum length: 255 characters |
use_public_ip |
No |
Boolean |
Specifies whether to use a public IP address for migration. Default value: true |
syncing |
No |
Boolean |
Specifies whether to perform a continuous synchronization after the first replication. If this parameter is not specified, the default value false is used. Default value: false |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
Yes |
String |
Specifies the source server ID. Minimum length: 0 characters Maximum length: 255 characters |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
btrfs_list |
No |
Array of BtrfsFileSystem objects |
Specifies the Btrfs information, which is obtained from the source server. |
disks |
Yes |
Array of TargetDisks objects |
Specifies the disk information. |
name |
Yes |
String |
Specifies the volume group name. Minimum length: 0 characters Maximum length: 255 characters |
vm_id |
Yes |
String |
Specifies the target server ID. Minimum length: 0 characters Maximum length: 255 characters |
volume_groups |
No |
Array of VolumeGroups objects |
Specifies the volume group information, which is obtained from the source server. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Specifies the file system name. Minimum length: 0 characters Maximum length: 255 characters |
label |
Yes |
String |
Specifies the file system tag. If no tag exists, the value is an empty string. Minimum length: 0 characters Maximum length: 255 characters |
uuid |
Yes |
String |
Specifies the UUID of the file system. Minimum length: 0 characters Maximum length: 255 characters |
device |
Yes |
String |
Specifies the device name in the Btrfs. Minimum length: 0 characters Maximum length: 255 characters |
size |
Yes |
Long |
Specifies the space occupied by the file system. Minimum value: 0 Maximum value: 9223372036854775807 |
nodesize |
Yes |
Long |
Specifies the size of the Btrfs node. Minimum value: 0 Maximum value: 9223372036854775807 |
sectorsize |
Yes |
Integer |
Specifies the sector size. Minimum value: 0 Maximum value: 2147483647 |
data_profile |
Yes |
String |
Specifies the data profile (RAD). Minimum length: 0 characters Maximum length: 255 characters |
system_profile |
Yes |
String |
Specifies the file system profile (RAD). Minimum length: 0 characters Maximum length: 255 characters |
metadata_profile |
Yes |
String |
Specifies the metadata profile (RAD). Minimum length: 0 characters Maximum length: 255 characters |
global_reserve1 |
Yes |
String |
Specifies the Btrfs file system information. Minimum length: 0 characters Maximum length: 255 characters |
g_vol_used_size |
Yes |
Long |
Specifies the used space of the Btrfs volume. Minimum value: 0 Maximum value: 9223372036854775807 |
default_subvolid |
Yes |
String |
Specifies the ID of the default subvolume. Minimum length: 0 characters Maximum length: 255 characters |
default_subvol_name |
Yes |
String |
Specifies the name of the default subvolume. Minimum length: 0 characters Maximum length: 255 characters |
default_subvol_mountpath |
Yes |
String |
Specifies the mount path of the default subvolume or Btrfs file system. Minimum length: 0 characters Maximum length: 255 characters |
subvolumn |
Yes |
Array of BtrfsSubvolumn objects |
Specifies the subvolume information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
uuid |
Yes |
String |
Specifies the UUID of the parent volume. Minimum length: 0 characters Maximum length: 255 characters |
is_snapshot |
Yes |
String |
Specifies whether the subvolume is a snapshot. Minimum length: 0 characters Maximum length: 255 characters |
subvol_id |
Yes |
String |
Specifies the subvolume ID. Minimum length: 0 characters Maximum length: 255 characters |
parent_id |
Yes |
String |
Specifies the parent volume ID. Minimum length: 0 characters Maximum length: 255 characters |
subvol_name |
Yes |
String |
Specifies the subvolume name. Minimum length: 0 characters Maximum length: 255 characters |
subvol_mount_path |
Yes |
String |
Specifies the mount path of the subvolume. Minimum length: 0 characters Maximum length: 255 characters |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
device_use |
No |
String |
Specifies the disk type. Default value: NORMAL The value can be:
|
disk_id |
No |
String |
Specifies the disk ID. This parameter is not required if the target server is automatically created. Minimum length: 0 characters Maximum length: 255 characters |
name |
Yes |
String |
Specifies the disk name. Set this parameter to Disk X based on the disk sequence. Minimum length: 0 characters Maximum length: 255 characters |
physical_volumes |
Yes |
Array of PhysicalVolumes objects |
Specifies the physical volume information. |
size |
Yes |
Long |
Specifies the volume size. Minimum value: 0 Maximum value: 9223372036854775807 |
used_size |
Yes |
Long |
Specifies the used space. Minimum value: 0 Maximum value: 9223372036854775807 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
device_use |
No |
String |
Specifies the partition type. The value can be NORMAL, BOOT, or OS. Minimum length: 0 characters Maximum length: 255 characters |
file_system |
No |
String |
Specifies the file system type. Minimum length: 0 characters Maximum length: 255 characters |
index |
No |
Integer |
Specifies the serial number of the volume. Minimum value: 0 Maximum value: 2147483647 |
mount_point |
No |
String |
Specifies the mount point. Minimum length: 0 characters Maximum length: 255 characters |
name |
No |
String |
Specifies the volume name. In Windows, it indicates the drive letter, and in Linux, it indicates the device ID. Minimum length: 0 characters Maximum length: 255 characters |
size |
No |
Long |
Specifies the volume size. Minimum value: 0 Maximum value: 9223372036854775807 |
used_size |
No |
Long |
Specifies the used space. Minimum value: 0 Maximum value: 9223372036854775807 |
uuid |
No |
String |
Specifies the GUID of the volume, which can be obtained from the source server. Minimum length: 0 characters Maximum length: 255 characters |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
components |
No |
String |
Specifies the physical volume information. Minimum length: 0 characters Maximum length: 255 characters |
free_size |
No |
Long |
Specifies the available space. Minimum value: 0 Maximum value: 9223372036854775807 |
logical_volumes |
No |
Array of LogicalVolumes objects |
Specifies the logical volume information. |
name |
No |
String |
Specifies the volume group name. Minimum length: 0 characters Maximum length: 255 characters |
size |
No |
Long |
Specifies the volume size. Minimum value: 0 Maximum value: 9223372036854775807 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
block_count |
No |
Integer |
Specifies the number of blocks. Minimum value: 0 Maximum value: 4294967296 Default value: 0 |
block_size |
No |
Long |
Specifies the block size. Minimum value: 0 Maximum value: 1048576 Default value: 0 |
file_system |
Yes |
String |
Specifies the file system. Minimum length: 0 characters Maximum length: 255 characters |
inode_size |
Yes |
Integer |
Specifies the number of inodes. Minimum value: 0 Maximum value: 4294967296 |
mount_point |
Yes |
String |
Specifies the mount point. Minimum length: 0 characters Maximum length: 256 characters |
name |
Yes |
String |
Specifies the volume group name. Minimum length: 0 characters Maximum length: 1,024 characters |
size |
Yes |
Long |
Specifies the volume size. Minimum value: 0 Maximum value: 9223372036854775807 |
used_size |
Yes |
Long |
Specifies the used space. Minimum value: 0 Maximum value: 9223372036854775807 |
free_size |
Yes |
Long |
Specifies the available space. Minimum value: 0 Maximum value: 9223372036854775807 |
Response
Status code: 200
Parameter |
Type |
Description |
---|---|---|
id |
String |
Specifies the task ID returned when the task is created successfully. Minimum length: 0 characters Maximum length: 255 characters |
Example Request
Create a migration task during which a new target server will be created.
POST https://{endpoint}/v3/tasks { "name" : "MigrationTask", "type" : "MIGRATE_FILE", "os_type" : "LINUX", "start_target_server" : true, "use_public_ip" : true, "migration_ip" : "192.168.0.1", "regionName": "CN North-Ulanqab203", "region_id" : "region_id", "project_name" : "project_name", "project_id" : "b276e6fb38c74aa2ba4598f049745ce9", "source_server" : { "id" : "16c03428-ff9a-4f36-84aa-583e41499bb2" }, "target_server" : { "vm_id" : "1900aab8-90c4-462c-b4c5-acdafc8fbeca", "name" : "Auto-tar-chengxiao", "disks" : [ { "name" : "/dev/vda", "disk_id" : "76a59f9f-5901-4913-a9a5-f6742baa308c", "size" : 42949672960, "device_use" : "BOOT", "physical_volumes" : [ { "uuid" : null, "index" : 0, "name" : "/dev/vda1", "device_use" : "OS", "file_system" : "ext4", "mount_point" : "/", "size" : 42947575808, "used_size" : 5346484224 } ] } ], "volume_groups" : [ ], "btrfs_list" : [ ] } }
Example Response
Status code: 200
OK
{ "id" : "8abda8635e09d185015e09d188dd0001xx" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
Error Codes
See 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