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

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 parameter, 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.

estimate_complete_time

long

Specifies the estimated remaining time of a migration task.

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 (default): indicates that the target ECS will be started after the migration.
  • 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).

float_ip

String

Specifies the floating IP address of the target ECS.

migration_ip

String

Specifies the IP address of the target ECS.

  • 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.

vm_template_id

String

Specifies the template ID. For details, see the ID obtained in Querying the Template List.

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 which the target ECS belongs to.

project_id

String

Specifies the ID of the project which the target ECS belongs to. For details, see Obtaining a Project ID.

sub_tasks

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 sub_tasks structure

Parameter

Type

Description

id

long

Specifies the subtask ID.

name

String

Specifies the subtask name.

  • CREATE_CLOUD_SERVER: Create an ECS during the migration.
  • SSL_CONFIG: Set a secure transmission channel.
  • 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, which can be changed after added. 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 source server OS 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 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 7.

Table 7 subvolumn data structure

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.

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 disk ID in EVS.

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.

device_use

String

Specifies the partition user.

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

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.

size_per_cluster

String

Specifies the size of each cluster.

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,
     "float_ip": "",
     "migration_ip": "X.X.X.X",
     "vm_template_id": "caa75db7-1748-42f4-b7e5-7b01fb5f89cf",
     "region_name":"MY-Kuala Lumpur",
     "region_id":"my-kualalumpur-1",
     "project_name":"my-kualalumpur-1",
     "project_id": "962def8b6e984888b80501c851d534b2",
     "sub_tasks": [{
       "id": 471,
       "name": "CREATE_CLOUD_SERVER",
       "progress": 100,
       "start_date": null,
       "end_date": null
      }, {
       "id": 475,
       "name": "SSL_CONFIG",
       "progress": 100,
       "start_date": null,
       "end_date": null
      }, 
     "id": 477,
       "name": "ATTACH_AGENT_IMAGE",
       "progress": 0,
       "start_date": null,
       "end_date": null
      }, {
       "id": 484,
       "name": "FORMAT_DISK_WINDOWS",
       "progress": 0,
       "start_date": null,
       "end_date": null
      }, {
       "id": 491,
       "name": "MIGRATE_WINDOWS_BLOCK",
       "progress": 0,
       "start_date": null,
       "end_date": null
      }, {
       "id": 498,
       "name": "CONFIGURE_WINDOWS",
       "progress": 0,
       "start_date": null,
       "end_date": null
      }, {
       "id": 505,
       "name": "DETTACH_AGENT_IMAGE",
       "progress": 0,
       "start_date": null,
       "end_date": null
      }
     ],
     "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",
          "size_per_cluster": 4096,
          "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",
          "size_per_cluster": 4096,
          "mount_point": null,
          "size": 42851106816,
          "used_size": 26961067520,
          "free_size": 15890039296
         }
        ]
       }
      ],
      "btrfs_list": [],
      "volume_groups": []
     }
    }

Status Codes

See Status Codes.