Updated on 2022-08-02 GMT+08:00

Querying a Migration Task with a Specified ID

Function

This API is used to query a migration task with a specified ID.

URI

GET /v3/tasks/{task_id}

Table 1 Path parameter

Parameter

Mandatory

Type

Description

task_id

Yes

String

Specifies the migration task ID.

Minimum length: 0 characters

Maximum length: 255 characters

Request

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

No

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

Response

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

name

String

Specifies the task name, which is defined by the user.

Minimum length: 0 characters

Maximum length: 255 characters

type

String

Specifies the task type. This parameter is mandatory for creating a task and optional for updating a task.

Minimum length: 0 characters

Maximum length: 255 characters

The value can be:

  • MIGRATE_FILE
  • MIGRATE_BLOCK

os_type

String

Specifies the OS type. This parameter is mandatory for creating a task and optional for updating a task.

The value can be:

  • WINDOWS
  • LINUX

id

String

Specifies the migration task ID.

Minimum length: 0 characters

Maximum length: 255 characters

priority

Integer

Specifies the migration process priority.

0: low

1: standard (default)

2: high

Minimum value: 0

Maximum value: 2

The value can be:

  • 0
  • 1
  • 2

region_id

String

Specifies the ID of the region where the target server is located.

Minimum length: 0 characters

Maximum length: 255 characters

start_target_server

Boolean

Specifies whether to start the target server after the migration.

true: indicates that the target server will be launched after the migration.

false: indicates that the target server will be stopped after the migration.

Default value: true

enterprise_project_id

String

Specifies the enterprise project ID.

Minimum length: 1 character

Maximum length: 255 characters

migration_ip

String

Specifies the IP address of the target server.

Enter the EIP of the target server if the migration network type is Internet.

Enter the private IP address the target server if the migration network type is Direct Connect or VPN.

Minimum length: 0 characters

Maximum length: 255 characters

region_name

String

Specifies the name of the region where the target server is located.

Minimum length: 0 characters

Maximum length: 255 characters

project_name

String

Specifies the name of the project to which the target server belongs.

Minimum length: 0 characters

Maximum length: 255 characters

project_id

String

Specifies the ID of the project to which the target server belongs.

Minimum length: 0 characters

Maximum length: 255 characters

vm_template_id

String

Specifies the template ID.

Minimum length: 0 characters

Maximum length: 255 characters

source_server

SourceServer object

Specifies the information about the source server in the migration task.

target_server

TaskTargetServer object

Specifies the information about the target server in the migration task.

state

String

Specifies the task status.

Minimum length: 0 characters

Maximum length: 255 characters

estimate_complete_time

Long

Specifies the estimated completion time.

Minimum value: 0

Maximum value: 9223372036854775807

connected

Boolean

Specifies the connection status.

create_date

Long

Specifies the task creation time.

Minimum value: 0

Maximum value: 9223372036854775807

start_date

Long

Specifies the task start time.

Minimum value: 0

Maximum value: 9223372036854775807

finish_date

Long

Specifies the task end time.

Minimum value: 0

Maximum value: 9223372036854775807

migrate_speed

Double

Specifies the migration rate, in MB/s.

Minimum value: 0

Maximum value: 10000

compress_rate

Double

Specifies the compression rate.

Minimum value: 0

Maximum value: 10000

error_json

String

Specifies the error message.

Minimum length: 0 characters

Maximum length: 1,024 characters

total_time

Long

Specifies the task duration.

Minimum value: 0

Maximum value: 9223372036854775807

float_ip

String

Retain this parameter temporarily to ensure the compatibility with the SMS-Agent of the earlier version.

Minimum length: 0 characters

Maximum length: 255 characters

remain_seconds

Long

Specifies the remaining migration time in seconds.

Minimum value: 0

Maximum value: 9223372036854775807

target_snapshot_id

String

Specifies the ID of the snapshot for the target server.

Minimum length: 0 characters

Maximum length: 255 characters

clone_server

CloneServer object

Specifies the information about the cloned server.

sub_tasks

Array of SubTask objects

Specifies the list of subtasks contained in the migration task.

Table 4 SourceServer

Parameter

Type

Description

id

String

Specifies the ID of the source server in the SMS database.

Minimum length: 0 characters

Maximum length: 255 characters

ip

String

Specifies the IP address of the source server. This parameter is mandatory for registering the source server with SMS and optional for updating the information about the source server.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the name of the source server displayed on the SMS console.

Minimum length: 0 characters

Maximum length: 255 characters

hostname

String

Specifies the host name of the source server. This parameter is mandatory for registering the source server with SMS and optional for updating the information about the source server.

Minimum length: 0 characters

Maximum length: 255 characters

os_type

String

Specifies the OS type of the source server. This parameter is mandatory for registering the source server with SMS and optional for updating the information about the source server.

Minimum length: 0 characters

Maximum length: 255 characters

The value can be:

  • WINDOWS
  • LINUX

os_version

String

Specifies the OS version.

Minimum length: 0 characters

Maximum length: 255 characters

firmware

String

Specifies the boot mode.

Minimum length: 0 characters

Maximum length: 255 characters

The value can be:

  • BIOS
  • UEFI

cpu_quantity

Integer

Specifies the number of CPUs.

Minimum value: 0

Maximum value: 65535

memory

Long

Specifies the memory size (MB).

Minimum value: 0

Maximum value: 9223372036854775807

disks

Array of ServerDisk objects

Specifies the disk information of the source server.

btrfs_list

Array of BtrfsFileSystem objects

Specifies the Btrfs information on the source server. This parameter is mandatory for Linux. If no Btrfs exists on the source server, an empty array will be returned.

networks

Array of NetWork objects

Specifies the NIC information of the source server.

domain_id

String

Specifies the domain ID of a tenant.

Minimum length: 0 characters

Maximum length: 255 characters

has_rsync

Boolean

Specifies whether rsync is installed. This parameter is mandatory for Linux.

paravirtualization

Boolean

Specifies whether the source server is paravirtualized. This parameter is mandatory for Linux.

raw_devices

String

Specifies the list of raw devices. This parameter is mandatory for Linux.

Minimum length: 0 characters

Maximum length: 255 characters

driver_files

Boolean

Specifies whether any driver files are missing. This parameter is mandatory for Windows.

system_services

Boolean

Specifies whether there are abnormal services. This parameter is mandatory for Windows.

account_rights

Boolean

Specifies whether the account has the required permissions. This parameter is mandatory for Windows.

boot_loader

String

Specifies the system boot mode. This parameter is mandatory for Linux.

The value can be:

  • GRUB
  • LILO

system_dir

String

Specifies the system directory. This parameter is mandatory for Windows.

Minimum length: 0 characters

Maximum length: 255 characters

volume_groups

Array of VolumeGroups objects

This parameter is mandatory for Linux. If there is no volume group, remain an empty array [].

agent_version

String

Specifies the Agent version.

Minimum length: 0 characters

Maximum length: 255 characters

Table 5 ServerDisk field description

Parameter

Type

Description

name

String

Specifies the disk name.

Minimum length: 0 characters

Maximum length: 255 characters

partition_style

String

Specifies the disk partition type. This parameter is mandatory for source server registration.

The value can be:

  • MBR
  • GPT

device_use

String

Specifies the disk type.

The value can be:

  • BOOT
  • OS

size

Long

Specifies the disk size, in bytes.

Minimum value: 0

Maximum value: 9223372036854775807

used_size

Long

Specifies the used disk space, in bytes.

Minimum value: 0

Maximum value: 9223372036854775807

physical_volumes

Array of PhysicalVolume objects

Specifies the physical partition information of the disk.

os_disk

Boolean

Specifies whether the disk is the system disk.

relation_name

String

Specifies the name of the corresponding disk on the target server running Linux.

Minimum length: 0 characters

Maximum length: 255 characters

Table 6 PhysicalVolume field description

Parameter

Type

Description

device_use

String

Specifies the partition type. The value can be NORMAL, BOOT, or OS.

Minimum length: 0 characters

Maximum length: 255 characters

file_system

String

Specifies the file system type.

Minimum length: 0 characters

Maximum length: 255 characters

index

Integer

Specifies the serial number of the volume.

Minimum value: 0

Maximum value: 2147483647

mount_point

String

Specifies the mount point.

Minimum length: 0 characters

Maximum length: 255 characters

name

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

Long

Specifies the volume size.

Minimum value: 0

Maximum value: 9223372036854775807

used_size

Long

Specifies the used space.

Minimum value: 0

Maximum value: 9223372036854775807

uuid

String

Specifies the GUID of the volume, which can be obtained from the source server.

Minimum length: 0 characters

Maximum length: 255 characters

size_per_cluster

Integer

Specifies the size of each cluster.

Minimum value: 0

Maximum value: 2147483647

Table 7 BtrfsFileSystem field description

Parameter

Type

Description

name

String

Specifies the file system name.

Minimum length: 0 characters

Maximum length: 255 characters

label

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

String

Specifies the UUID of the file system.

Minimum length: 0 characters

Maximum length: 255 characters

device

String

Specifies the device name in the Btrfs.

Minimum length: 0 characters

Maximum length: 255 characters

size

Long

Specifies the space occupied by the file system.

Minimum value: 0

Maximum value: 9223372036854775807

nodesize

Long

Specifies the size of the Btrfs node.

Minimum value: 0

Maximum value: 9223372036854775807

sectorsize

Integer

Specifies the sector size.

Minimum value: 0

Maximum value: 2147483647

data_profile

String

Specifies the data profile (RAD).

Minimum length: 0 characters

Maximum length: 255 characters

system_profile

String

Specifies the file system profile (RAD).

Minimum length: 0 characters

Maximum length: 255 characters

metadata_profile

String

Specifies the metadata profile (RAD).

Minimum length: 0 characters

Maximum length: 255 characters

global_reserve1

String

Specifies the Btrfs file system information.

Minimum length: 0 characters

Maximum length: 255 characters

g_vol_used_size

Long

Specifies the used space of the Btrfs volume.

Minimum value: 0

Maximum value: 9223372036854775807

default_subvolid

String

Specifies the ID of the default subvolume.

Minimum length: 0 characters

Maximum length: 255 characters

default_subvol_name

String

Specifies the name of the default subvolume.

Minimum length: 0 characters

Maximum length: 255 characters

default_subvol_mountpath

String

Specifies the mount path of the default subvolume or Btrfs file system.

Minimum length: 0 characters

Maximum length: 255 characters

subvolumn

Array of BtrfsSubvolumn objects

Specifies the subvolume information.

Table 8 BtrfsFileSystem field description

Parameter

Type

Description

uuid

String

Specifies the UUID of the parent volume.

Minimum length: 0 characters

Maximum length: 255 characters

is_snapshot

String

Specifies whether the subvolume is a snapshot.

Minimum length: 0 characters

Maximum length: 255 characters

subvol_id

String

Specifies the subvolume ID.

Minimum length: 0 characters

Maximum length: 255 characters

parent_id

String

Specifies the parent volume ID.

Minimum length: 0 characters

Maximum length: 255 characters

subvol_name

String

Specifies the subvolume name.

Minimum length: 0 characters

Maximum length: 255 characters

subvol_mount_path

String

Specifies the mount path of the subvolume.

Minimum length: 0 characters

Maximum length: 255 characters

Table 9 NetWork field description

Parameter

Type

Description

name

String

Specifies the NIC name.

Minimum length: 0 characters

Maximum length: 255 characters

ip

String

Specifies the IP address bound to the NIC.

Minimum length: 0 characters

Maximum length: 255 characters

netmask

String

Specifies the subnet mask.

Minimum length: 0 characters

Maximum length: 255 characters

gateway

String

Specifies the gateway.

Minimum length: 0 characters

Maximum length: 255 characters

mtu

Integer

Specifies the NIC MTU. This parameter is mandatory for Linux.

Minimum value: 0

Maximum value: 2147483647

mac

String

Specifies the MAC address.

Minimum length: 0 characters

Maximum length: 255 characters

id

String

Specifies the database ID.

Minimum length: 0 characters

Maximum length: 255 characters

Table 10 TaskTargetServer field description

Parameter

Type

Description

id

String

Specifies the ID of the source server in the SMS database.

Minimum length: 0 characters

Maximum length: 255 characters

vm_id

String

Specifies the ID of the target server. This parameter is not required for automatically created target server.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the name of the target server.

Minimum length: 0 characters

Maximum length: 255 characters

ip

String

Specifies the IP address of the target server.

Minimum length: 0 characters

Maximum length: 255 characters

os_type

String

Specifies the OS type of the source server. This parameter is mandatory for registering the source server with SMS and optional for updating the information about the source server.

Minimum length: 0 characters

Maximum length: 255 characters

The value can be:

  • WINDOWS
  • LINUX

os_version

String

Specifies the OS version.

Minimum length: 0 characters

Maximum length: 255 characters

system_dir

String

Specifies the system directory. This parameter is mandatory for Windows.

Minimum length: 0 characters

Maximum length: 255 characters

disks

Array of TargetDisk objects

Specifies the disk information of the target server, which is generally the same as that of the source server.

volume_groups

Array of VolumeGroups objects

Specifies the logical volume information of the target server, which is generally the same as that on the source server.

btrfs_list

Array of strings

Specifies the Btrfs information on the source server. This parameter is mandatory for Linux. If no Btrfs exists on the source server, an empty array will be returned.

image_disk_id

String

Specifies the ID of the disk where the agent image resides on the target server.

Minimum length: 0 characters

Maximum length: 255 characters

cutovered_snapshot_ids

String

Specifies the ID of the snapshot used for rollback on the target server.

Minimum length: 0 characters

Maximum length: 255 characters

Table 11 TargetDisk field description

Parameter

Type

Description

device_use

String

Specifies the disk type.

Default value: NORMAL

The value can be:

  • NORMAL
  • OS
  • BOOT

disk_id

String

Specifies the disk ID.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the disk name.

Minimum length: 0 characters

Maximum length: 255 characters

physical_volumes

Array of TargetPhysicalVolumes objects

Specifies the logical volume information.

size

Long

Specifies the volume size.

Minimum value: 0

Maximum value: 9223372036854775807

used_size

Long

Specifies the used space.

Minimum value: 0

Maximum value: 9223372036854775807

Table 12 TargetPhysicalVolumes field description

Parameter

Type

Description

device_use

String

Specifies the partition type.

Default value: NORMAL

The value can be:

  • NORMAL
  • OS
  • BOOT

file_system

String

Specifies the file system.

Minimum length: 0 characters

Maximum length: 255 characters

index

Integer

Specifies the volume ID.

Minimum value: 0

Maximum value: 2147483647

mount_point

String

Specifies the mount point.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the volume group name.

Minimum length: 0 characters

Maximum length: 255 characters

size

Long

Specifies the volume size.

Minimum value: 0

Maximum value: 9223372036854775807

used_size

Long

Specifies the used space.

Minimum value: 0

Maximum value: 9223372036854775807

uuid

String

uuid

Minimum length: 0 characters

Maximum length: 255 characters

Table 13 VolumeGroups field description

Parameter

Type

Description

components

String

Specifies the physical volume information.

Minimum length: 0 characters

Maximum length: 255 characters

free_size

Long

Specifies the available space.

Minimum value: 0

Maximum value: 9223372036854775807

logical_volumes

Array of LogicalVolumes objects

Specifies the logical volume information.

name

String

Specifies the volume group name.

Minimum length: 0 characters

Maximum length: 255 characters

size

Long

Specifies the volume size.

Minimum value: 0

Maximum value: 9223372036854775807

Table 14 LogicalVolumes field description

Parameter

Type

Description

block_count

Integer

Specifies the number of blocks.

Minimum value: 0

Maximum value: 4294967296

Default value: 0

block_size

Long

Specifies the block size.

Minimum value: 0

Maximum value: 1048576

Default value: 0

file_system

String

Specifies the file system.

Minimum length: 0 characters

Maximum length: 255 characters

inode_size

Integer

Specifies the number of inodes.

Minimum value: 0

Maximum value: 4294967296

mount_point

String

Specifies the mount point.

Minimum length: 0 characters

Maximum length: 256 characters

name

String

Specifies the volume group name.

Minimum length: 0 characters

Maximum length: 1,024 characters

size

Long

Specifies the volume size.

Minimum value: 0

Maximum value: 9223372036854775807

used_size

Long

Specifies the used space.

Minimum value: 0

Maximum value: 9223372036854775807

free_size

Long

Specifies the available space.

Minimum value: 0

Maximum value: 9223372036854775807

Table 15 CloneServer field description

Parameter

Type

Description

vm_id

String

Specifies the cloned server ID.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the name of the cloned server.

Minimum length: 0 characters

Maximum length: 255 characters

clone_error

String

Specifies the error message returned for cloning failure.

Minimum length: 0 characters

Maximum length: 255 characters

clone_state

String

Specifies the cloning status.

Minimum length: 0 characters

Maximum length: 255 characters

error_msg

String

Specifies the error message returned for cloning failure.

Minimum length: 0 characters

Maximum length: 1,024 characters

Table 16 SubTask field description

Parameter

Type

Description

name

String

Specifies the subtask name.

Minimum length: 0 characters

Maximum length: 255 characters

progress

Integer

Specifies the progress of the subtask. The value is an integer ranging from 0 to 100.

Minimum value: 0

Maximum value: 100

start_date

Long

Specifies the start time of the subtask.

Minimum value: 0

Maximum value: 9223372036854775807

end_date

Long

Specifies the end time of the subtask. If the subtask is not complete, this parameter is left blank.

Minimum value: 0

Maximum value: 9223372036854775807

migrate_speed

Double

Specifies the migration speed in Mbit/s.

Minimum value: 0

Maximum value: 10000

user_op

String

Specifies the user operation that triggers the subtask.

Minimum length: 0 characters

Maximum length: 50 characters

process_trace

String

Detailed progress of the migration or synchronization

Minimum length: 0 characters

Maximum length: 2048 characters

Example Request

Querying a Migration Task with a Specified ID

GET https://{endpoint}/v3/tasks/ef3b9722-07a0-40ae-89b0-889ee96dfc56

Example Response

Status code: 200

OK

{
  "id" : "1dcbf9f2-9f2a-4df8-88dc-27e5614a1187",
  "name" : "MigrationTask",
  "type" : "MIGRATE_BLOCK",
  "os_type" : "WINDOWS",
  "state" : "RUNNING",
  "estimate_complete_time" : null,
  "create_date" : 1598435778000,
  "start_date" : 1598435784000,
  "finish_date" : null,
  "priority" : 1,
  "speed_limit" : 0,
  "migrate_speed" : 0.0,
  "start_target_server" : true,
  "error_json" : "",
  "total_time" : 115,
  "float_ip" : null,
  "migration_ip" : null,
  "vm_template_id" : "38d53ae9-70e3-4587-89c9-6219d3d4e962",
  "region_name" : "region name",
  "region_id" : "region id",
  "project_name" : "project name",
  "project_id" : "b276e6fb38c74aa2ba4598f049745ce9",
  "sub_tasks" : [ {
    "id" : 7278,
    "name" : "CREATE_CLOUD_SERVER",
    "progress" : 0,
    "start_date" : 1598435802000,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  }, {
    "id" : 7279,
    "name" : "SSL_CONFIG",
    "progress" : 0,
    "start_date" : null,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  }, {
    "id" : 7280,
    "name" : "ATTACH_AGENT_IMAGE",
    "progress" : 0,
    "start_date" : null,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  }, {
    "id" : 7281,
    "name" : "FORMAT_DISK_WINDOWS",
    "progress" : 0,
    "start_date" : null,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  }, {
    "id" : 7282,
    "name" : "MIGRATE_WINDOWS_BLOCK",
    "progress" : 0,
    "start_date" : null,
    "end_date" : null,
    "user_op" : "REPLICATE",
    "process_trace" : null
  } ],
  "source_server" : {
    "id" : "1cce5dab-df33-4abe-b2ac-e94fa05d6a01",
    "ip" : "192.168.0.154",
    "name" : "longbin-win16",
    "os_type" : "WINDOWS",
    "os_version" : "WINDOWS2016_64BIT",
    "oem_system" : false,
    "state" : "initialize",
    "migration_cycle" : "replicating"
  },
  "target_server" : {
    "id" : "c1bd67b6-1caa-403e-9e32-81d2feafcda9",
    "vm_id" : "",
    "name" : "",
    "ip" : null,
    "os_type" : "WINDOWS",
    "os_version" : "WINDOWS2016_64BIT",
    "system_dir" : "Y:\\Windows\\System32",
    "disks" : [ {
      "id" : 88008,
      "name" : "Disk 1",
      "relation_name" : null,
      "disk_id" : "0",
      "partition_style" : "MBR",
      "size" : 42949672960,
      "used_size" : 42947575808,
      "device_use" : "OS",
      "os_disk" : true,
      "physical_volumes" : [ {
        "id" : 135055,
        "uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-100000000000}\\",
        "index" : 1,
        "name" : "Z:",
        "relation_name" : null,
        "device_use" : "BOOT",
        "file_system" : "NTFS",
        "mount_point" : null,
        "size" : 524288000,
        "used_size" : 410275840,
        "free_size" : 114012160
      }, {
        "id" : 135056,
        "uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-501f00000000}\\",
        "index" : 2,
        "name" : "Y:",
        "relation_name" : null,
        "device_use" : "OS",
        "file_system" : "NTFS",
        "mount_point" : null,
        "size" : 42423287808,
        "used_size" : 23170301952,
        "free_size" : 19252985856
      } ],
      "disk_index" : "\u0000"
    } ],
    "volume_groups" : [ ],
    "image_disk_id" : null,
    "cutovered_snapshot_ids" : null
  },
  "clone_server" : null
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.