Help Center> Server Migration Service> API Reference> APIs> Task Management> Querying a Migration Task by Task ID

Querying a Migration Task by Task ID

Function

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

URI

GET /v1/sms/tasks/{task_id}

For details about the parameters, see Table 1.
Table 1 Parameter description

Parameter

Mandatory

Description

task_id

Yes

Specifies the task ID.

Request

N/A

Response

Response parameters

For details about the response parameters, see Table 2.

Table 2 Response parameters

Parameter

Type

Description

id

String

Specifies the task ID.

name

String

Specifies the task name.

type

String

Specifies the task type.

  • MIGRATE_FILE: indicates the file-level migration.
  • MIGRATE_BLOCK: indicates the block-level migration.

os_type

String

  • WINDOWS: indicates that the source server runs a Windows OS.
  • LINUX: indicates that the source server runs a Linux OS.

state

String

Specifies the task status. The value can be any of the following:

  • READY: indicates that the migration task is ready to start.
  • RUNNING: indicates that the migration task is being executed.
  • SYNCING: indicates that the incremental data is being synchronized from the source to target ECSs.
  • ABORTING: indicates that the migration task is being paused.
  • ABORT: indicates that the migration task is paused.
  • MIGRATE_FAIL: indicates that the migration fails.
  • MIGRATE_SUCCESS: indicates that the migration succeeds.
  • SYNC_FAIL: indicates that the synchronization fails.
  • SYNC_SUCCESS: indicated that the synchronization succeeds.

connected

Boolean

Specifies the connection status.

  • true: indicates that the migration task is properly connected to SMS.
  • false: indicates that the migration task is disconnected from SMS.

create_date

long

Specifies the task creation time.

start_date

long

Specifies the task start time.

finish_date

long

Specifies the task end time.

priority

int

Specifies the migration process priority.

  • 0: Low
  • 1: Standard (default)
  • 2: High

speed_limit

int

Specifies the migration rate limit (in MB).

The default value is 0, indicating that the migration rate is not limited.

migrate_speed

float

Specifies the migration rate.

start_target_server

Boolean

Specifies the status of the target ECS after the migration is complete.

  • true: indicates that the target ECS will be started after the migration. The default value is true.
  • false: indicates that the target ECS will be stopped after the migration.

error_json

String

Specifies the task failure cause.

total_time

long

Specifies the total task duration (in ms).

migration_ip

String

Specifies the target ECS IP address.

  • Enter the elastic IP address if the migration network type is Internet.
  • Enter a private IP address if the migration network type is a private line or VPN.

region_name

String

Specifies the region name of the target ECS.

region_id

String

Specifies the region ID of the target ECS.

project_name

String

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

project_id

String

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

sub_task_list

JSON array

Specifies the list of sub tasks. For details, see Table 3.

source_server

JSON

Specifies the source server information. For details, see Table 4.

target_server

JSON

Specifies the target ECS information. For details, see Table 5.

Table 3 Structure members of sub_task_list

Parameter

Type

Description

id

long

Specifies the subtask ID.

name

String

Specifies the subtask name.

  • ATTACH_AGENT_IMAGE: Attach an agent image.
  • DETTACH_AGENT_IMAGE: Detach an agent image.
  • FORMAT_DISK_LINUX: Format a Linux partition.
  • FORMAT_DISK_WINDOWS: Format a Windows partition.
  • MIGRATE_LINUX_FILE: Migrate Linux file-level data.
  • MIGRATE_WINDOWS_BLOCK: Migrate Windows block-level data.
  • SYNC_LINUX_FILE: Synchronize Linux file-level data.
  • SYNC_WINDOWS_BLOCK: Synchronize Windows block-level data.
  • CONFIGURE_LINUX: Modify Linux configurations.
  • CONFIGURE_WINDOWS: Modify Windows configurations.

progress

int

Specifies the sub task progress.

start_date

long

Specifies the sub task start time.

end_date

long

Specifies the sub task end time.

Table 4 source_server structure

Parameter

Type

Description

id

String

Specifies the ID of the source server in SMS.

ip

String

Specifies the IP address of the source server.

name

String

Specifies the name of the source server. You can change the name after adding it. The default value is the same as that of hostname.

os_type

String

  • WINDOWS: indicates that the source server runs a Windows OS.
  • LINUX: indicates that the source server runs a Linux OS.

os_version

String

Specifies the OS version.

For example, the version can be WINDOWS2008_R2_64BIT.

oem_system

Boolean

Specifies whether the OS of the source server is an OEM OS.

state

String

Specifies the check status of the source server.

  • CHECKING: indicates that the source server is being checked.
  • AVAILABLE: indicates that the check is passed, and the server data can be migrated.
  • UNAVAILABLE: indicates that the check fails, and the migration cannot be performed.
Table 5 target_server structure

Parameter

Type

Description

id

String

Specifies the ID of the source server in SMS.

vm_id

String

Specifies the ID of the target ECS.

name

String

Specifies the name of the target ECS.

ip

String

Specifies the private IP address of the target ECS server.

os_type

String

Specifies the OS type of the target ECS.

  • WINDOWS: indicates that the target ECS runs a Windows OS.
  • LINUX: indicates that the target ECS runs a Linux OS.

os_version

String

Specifies the OS version of the target ECS.

system_dir

String

Specifies the system directory.

For example, the directory can be C:\\Windows\\System32.

disks

JSON array

Specifies the disk information of the target ECS.

volume_groups

JSON array

Specifies the volume group information of the target ECS.

btrfs_list

JSON array

Specifies the Btrfs information of the target ECS. For details, see Table 6.

Table 6 btrfs_list data structure

Parameter

Type

Description

name

String

Specifies the file system name, for example, /dev/vdb1.

label

String

Specifies the file system label. If no label 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 subvolume ID.

default_subvol_name

String

Specifies the default subvolume name.

default_subvol_mountpath

String

Specifies the mount path of the default subvolume.

subvolumn

JSON array

Specifies the subvolume information. For details, see Table 7.

Table 7 subvolumn data structure

Parameter

Mandatory

Type

Description

uuid

Yes

String

Specifies the parent volume UUID of the subvolume.

is_snapshot

Yes

String

Specifies whether the subvolume is snapshot.

subvol_id

Yes

String

Specifies the subvolume ID.

parent_id

Yes

String

Specifies the parent volume ID of the subvolume.

subvol_name

Yes

String

Specifies the subvolume name.

subvol_mount_path

Yes

String

Specifies the mount path of the subvolume.

Table 8 disks data structure members

Parameter

Type

Description

id

long

Specifies the ID of the disk in the SMS database.

name

String

Specifies the disk name.

relation_name

String

Specifies the name of the source disk corresponding to the destination disk.

disk_id

String

Specifies the EVS ID of the disk.

partition_style

String

Specifies the disk partition type.

  • MBR
  • GPT

size

long

Specifies the disk size.

os_disk

String

Specifies whether the disk is the system disk.

used_size

String

Specifies the size of the used disk space.

physical_volumes

JSON array

Specifies the physical volume information of the disk. For details, see Table 9.

Table 9 Structure members of physical_volumes

Parameter

Type

Description

id

long

Specifies the ID of the physical partition in the database.

uuid

String

Specifies the partition UUID.

index

long

Specifies the serial number of the partition.

relation_name

String

Specifies the name of the source partition corresponding to the destination partition.

name

String

Specifies the partition name, for example, C in the Windows OS and /dev/vda1 in a Linux OS.

device_use

String

Specifies the partition user.

  • BOOT: indicates the boot partition.
  • OS: indicates the system partition.
  • NORMAL: indicates the common partition.

file_system

String

Specifies the file system type of the partition.

For example, the value can be NTFS.

mount_point

String

Specifies the mount point of the partition.

size

long

Specifies the total partition size.

used_size

long

Specifies the used partition size.

free_size

long

Specifies the size of the available partition space.

Example

  • Example request

    None

  • Example response
    {
     "id": "65da430b-9538-4296-abd0-86a5aaf13c77",
     "name": "sms_task_smssource",
     "type": "MIGRATE_BLOCK",
     "os_type": "WINDOWS",
     "state": "READY",
     "connected": true,
     "estimate_complete_time": null,
     "create_date": 1528699579000,
     "start_date": null,
     "finish_date": null,
     "priority": 1,
     "speed_limit": 0,
     "migrate_speed": 0.0,
     "start_target_server": true,
     "error_json": "",
     "total_time": 0,
     "migration_ip": "192.168.1.175",
     "region_name":"north-china",
     "region_id":"cn-north-1",
     "project_name":"cn-north-1",
     "project_id": "962def8b6e984888b80501c851d534b2",
     "sub_tasks": [{
       "id": 477,
       "name": "ATTACH_AGENT_IMAGE",
       "progress": 0,
       "start_date": null,
       "end_date": null,
       "totalTime": 0
      }, {
       "id": 484,
       "name": "FORMAT_DISK_WINDOWS",
       "progress": 0,
       "start_date": null,
       "end_date": null,
       "totalTime": 0
      }, {
       "id": 491,
       "name": "MIGRATE_WINDOWS_BLOCK",
       "progress": 0,
       "start_date": null,
       "end_date": null,
       "totalTime": 0
      }, {
       "id": 498,
       "name": "CONFIGURE_WINDOWS",
       "progress": 0,
       "start_date": null,
       "end_date": null,
       "totalTime": 0
      }, {
       "id": 505,
       "name": "DETTACH_AGENT_IMAGE",
       "progress": 0,
       "start_date": null,
       "end_date": null,
       "totalTime": 0
      }
     ],
     "source_server": {
      "id": "a013ec5f-00d6-456b-8c1f-085599cb97e9",
      "ip": "192.168.1.57",
      "name": "smssource",
      "os_type": "WINDOWS",
      "os_version": "WINDOWS2008_R2_64BIT",
      "oem_system": false,
      "state": "AVAILABLE"
     },
     "target_server": {
      "id": "ec5eca22-db21-49b0-ae53-56a74f0318ec",
      "vm_id": "7c804c50-e9eb-40af-86ec-c78da64f22e2",
      "name": "smssrc",
      "ip": null,
      "os_type": "WINDOWS",
      "os_version": "WINDOWS2008_R2_64BIT",
      "system_dir": "Y:\\Windows\\System32",
      "disks": [{
        "id": 736,
        "name": "Disk 1",
        "disk_id": "e853bb2d-57e0-42b2-96c0-68794063fb0f",
        "partition_style": "MBR",
        "size": 53687091200,
        "used_size": 42964353024,
        "os_disk": true,
        "physical_volumes": [{
          "id": 1135,
          "uuid": "\\?\Volume{f5a31ed9-cde8-11e6-9dd0-806e6f6e6963}\",
          "index": 1,
          "name": "Z:",
          "device_use": "BOOT",
          "file_system": "NTFS",
          "mount_point": null,
          "size": 113246208,
          "used_size": 25624064,
          "free_size": 87622144
         }, {
          "id": 1142,
          "uuid": "\\?\Volume{f5a31eda-cde8-11e6-9dd0-806e6f6e6963}\",
          "index": 2,
          "name": "Y:",
          "device_use": "OS",
          "file_system": "NTFS",
          "mount_point": null,
          "size": 42851106816,
          "used_size": 26961067520,
          "free_size": 15890039296
         }
        ]
       }
      ],
      "btrfs_list": [],
      "volume_groups": []
     }
    }

Status Code

For details about the status code, see Status Code.

Error Code

For details, see Error Code.