Help Center > > API Reference> APIs> Source Server Management> Querying a Source Server by Server ID

Querying a Source Server by Server ID

Updated at: Jul 19, 2019 GMT+08:00

Function

After the migration Agent reports the source server information to SMS, SMS checks the migration feasibility. This API returns the basic information and check results of the source server.

URI

GET /v1/sms/sources/{source_id}

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

Parameter

Mandatory

Description

source_id

Yes

Specifies the source server 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 ID of the source server in SMS.

ip

String

Specifies the IP address of the source server.

os_type

String

Specifies the OS type of the source server. The value can be WINDOWS or LINUX.

os_version

String

Specifies the OS version, for example, WINDOWS7_64BIT.

name

String

Specifies the name of the source server. The name can be changed.

hostname

String

Specifies the name displayed after you log in to the source server.

add_date

long

Specifies the time duration used for adding information about the source server to SMS. The unit is ms.

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 to the cloud.
  • UNAVAILABLE: indicates that the check fails, and the migration cannot be performed.

connected

Boolean

Specifies whether the source server is properly connected to SMS.

  • true: indicates that the source server is properly connected to SMS.
  • false: indicates that the source server is disconnected from SMS.

firmware

String

Specifies the boot type of the source server. The value can be BIOS or UEFI.

cpu_quantity

Integer

Specifies the number of CPUs.

memory

long

Specifies the memory size (MB).

disks

JSON array

Specifies the disk information of the source server. For details, see Table 3.

volume_groups

JSON array

Specifies the volume group information of the Linux host. For details, see Table 5.

network

JSON array

Specifies the NIC information of the source server. For details, see Table 7.

checks

JSON array

Specifies the check item of the source server. For details, see Table 8.

init_target_server

JSON

Specifies the recommended configurations of the target ECS. For details, see Table 9.

Table 3 Data structure of disks

Parameter

Type

Description

name

String

Specifies the disk name.

partition_style

String

Specifies the disk partition type. For example, the partition type can be MBR or GPT.

size

long

Specifies the total disk capacity (byte).

used_size

long

Specifies the size of the used disk space (byte).

device_use

String

Specifies the disk function.

  • BOOT: indicates that the boot partition is on the disk.
  • OS: indicates that the system partition is on the disk.

os_disk

Boolean

Specifies whether the disk is the system disk.

  • true: System disk
  • false: Data disk

physical_volumes

JSON array

Specifies the physical partition information on the disk. For details, see Table 4.

Table 4 Data structure of data elements in physical_volumes

Parameter

Type

Description

uuid

String

Specifies the partition UUID.

index

Integer

Specifies the serial number of the physical partition.

  • 0: First partition
  • 1: Second 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. The value can be OS or BOOT.

file_system

String

Specifies the file system type of the partition.

mount_point

String

Specifies the mount point.

size

Long

Specifies the total partition size.

used_size

Long

Specifies the used partition size.

Table 5 volume_groups data structure

Parameter

Type

Description

name

String

Specifies the volume group name.

components

String

Specifies the name of the physical partition and disk that are used to create the volume group.

size

long

Specifies the total volume group size.

free_size

long

Specifies the available space size (byte).

logic_volumes

JSON array

Specifies the information about logical volumes in a volume group. For details, see Table 6.

Table 6 logic_volumes data structure

Parameter

Type

Description

name

String

Specifies the name of the logical partition.

size

long

Specifies the total partition size.

used_size

long

Specifies the used partition size (byte).

free_size

long

Specifies the available partition size (byte).

file_system

String

Specifies the file system type of the partition.

mount_point

String

Specifies the mount point of the logical volume.

uuid

String

Specifies the partition UUID.

inode_size

int

Specifies the file system Inode size.

block_size

int

Specifies the file system block size (byte).

block_count

long

Specifies the total number of logical partition blocks.

Table 7 network data structure

Parameter

Type

Description

name

String

Specifies the NIC name.

ip

String

Specifies the IP address bound to the NIC.

netmask

String

Specifies the subnet mask.

gateway

String

Specifies the gateway.

mtu

Integer

Specifies the maximum transmission unit (MTU) of the NIC.

Table 8 checks data structure

Parameter

Type

Description

id

String

Specifies the check item ID.

name

String

Specifies the check item name.

result

String

Specifies the check result.

  • OK: The check is passed.
  • WARN: An alarm is generated.
  • ERROR: The check is not passed.

error_code

String

Specifies the error code generated for a failed check item.

error_params

Integer

Specifies the error parameter for a failed check item.

Table 9 init_target_server data structure

Parameter

Type

Description

disks

JSON array

Specifies the recommended disk information of the target ECS. For details, see Table 10.

Table 10 Structure members of the disks array

Parameter

Type

Description

name

String

Specifies the disk name.

size

long

Specifies the disk capacity (byte).

device_use

String

Specifies the disk function.

  • OS: indicates the system disk.
  • NORMAL: indicates the data disk.

Example

  • Example request

    None

  • Example response
    • Response when the source server runs the Windows OS
      {
        "id": "f36fa247-ac20-48b7-ba80-941b31d7718c",
        "ip": "10.40.45.118",
        "name": "szxy2",
        "hostname": "szxy2",
        "add_date": 1528675263000,
        "os_type": "WINDOWS",
        "os_version": "WINDOWS7_64BIT",
        "oem_system": false,
        "state": "AVAILABLE",
        "connected": false,
        "firmware": "BIOS",
        "cpu_quantity": 4,
        "memory": 17171075072,
        "current_task": null,
        "disks": [
          {
            "name": "Disk 0",
            "partition_style": "MBR",
            "relation_name": null,
            "size": 85897247744,
            "used_size": 85897247744,
            "device_use": "BOOT",
            "os_disk": false,
            "physical_volumes": [
              {
                "uuid": "\\?\Volume{e36afecb-24da-11e7-b949-806e6f6e6963}\",
                "index": 0,
                "name": "(Reserved)",
                "dos_name": null,
                "relation_name": null,
                "file_system": "NTFS",
                "size_per_cluster": 4096,
                "start_offset": 1048576,
                "total_sectors": 0,
                "hiden_sectors": 0,
                "sectors_per_track": 0,
                "start_sectors": 2048,
                "mount_point": null,
                "size": 104857088,
                "used_size": 25878016,
                "snap_mount_point": null,
                "device_use": "BOOT"
              },
              {
                "uuid": "\\?\Volume{e36afecc-24da-11e7-b949-806e6f6e6963}\",
                "index": 0,
                "name": "C:\\",
                "dos_name": null,
                "relation_name": null,
                "file_system": "NTFS",
                "size_per_cluster": 4096,
                "start_offset": 105906176,
                "total_sectors": 0,
                "hiden_sectors": 0,
                "sectors_per_track": 0,
                "start_sectors": 206848,
                "mount_point": null,
                "size": 85792390656,
                "used_size": 55866973696,
                "snap_mount_point": null,
                "device_use": "OS"
              }
            ]
          },
          {
            "name": "Disk 1",
            "partition_style": "MBR",
            "relation_name": null,
            "size": 214745218560,
            "used_size": 214745218560,
            "device_use": "",
            "os_disk": false,
            "physical_volumes": [
              {
                "uuid": "\\?\Volume{e36afecd-24da-11e7-b949-806e6f6e6963}\",
                "index": 0,
                "name": "D:\\",
                "dos_name": null,
                "relation_name": null,
                "file_system": "NTFS",
                "size_per_cluster": 4096,
                "start_offset": 1048576,
                "total_sectors": 0,
                "hiden_sectors": 0,
                "sectors_per_track": 0,
                "start_sectors": 2048,
                "mount_point": null,
                "size": 214745218560,
                "used_size": 128071798272,
                "snap_mount_point": null,
                "device_use": ""
              }
            ]
          }
        ],
        "volume_groups": [],
        "networks": [
          {
            "name": null,
            "ip": null,
            "netmask": null,
            "gateway": null,
            "mtu": 0,
            "mac": "0XB93064096C2C"
          }
        ],
        "checks": [
          {
            "id": 20749,
            "params": [
              ""
            ],
            "name": "OS_VERSION",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20756,
            "params": [
              ""
            ],
            "name": "FIRMWARE",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20763,
            "params": [
              ""
            ],
            "name": "CPU",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20770,
            "params": [
              ""
            ],
            "name": "MEMORY",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20777,
            "params": [
              ""
            ],
            "name": "SYSTEM_ROOT",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20784,
            "params": [
              ""
            ],
            "name": "PARTITION_STYLE",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20791,
            "params": [
              ""
            ],
            "name": "FILE_SYSTEM",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20798,
            "params": [
              ""
            ],
            "name": "FREE_SPACE",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20805,
            "params": [
              ""
            ],
            "name": "OEM_SYSTEM",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20812,
            "params": [
              ""
            ],
            "name": "DRIVER_FILE",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20819,
            "params": [
              ""
            ],
            "name": "SERVICE",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 20826,
            "params": [
              ""
            ],
            "name": "ACCOUNT_RIGHTS",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          }
        ],
        "init_target_server": null
      }         
    • Response for the source server that runs a Linux OS
      {
        "id": "45a02115-28a9-40c2-8604-0abfc9889c9d",
        "ip": "192.168.0.151",
        "name": "novalocal",
        "hostname": null,
        "add_date": 1532658611000,
        "os_type": "LINUX",
        "os_version": "CENTOS_7_2_64BIT",
        "oem_system": false,
        "state": "AVAILABLE",
        "connected": false,
        "firmware": "BIOS",
        "cpu_quantity": 2,
        "memory": 4,
        "current_task": null,
        "disks": [
          {
            "name": "/dev/xvda",
            "relation_name": null,
            "partition_style": "MBR",
            "size": 42949672960,
            "used_size": 42948606976,
            "device_use": "NORMAL",
            "os_disk": false,
            "physical_volumes": [
              {
                "uuid": null,
                "index": 0,
                "name": "/dev/xvda1",
                "device_use": "NORMAL",
                "file_system": "ext3",
                "mount_point": "/",
                "size": 42948606976,
                "used_size": 2853855232
              }
            ]
          },
          {
            "name": "/dev/xvdb",
            "relation_name": null,
            "partition_style": "MBR",
            "size": 10737418240,
            "used_size": 6442450944,
            "device_use": "NORMAL",
            "os_disk": false,
            "physical_volumes": [
              {
                "uuid": null,
                "index": 0,
                "name": "/dev/xvdb1",
                "device_use": "NORMAL",
                "file_system": "swap",
                "mount_point": "",
                "size": 1073741824,
                "used_size": 1073741824
              },
              {
                "uuid": null,
                "index": 0,
                "name": "/dev/xvdb2",
                "device_use": "VOLUME_GROUP",
                "file_system": "LVM2_member",
                "mount_point": "",
                "size": 5368709120,
                "used_size": 5368709120
              }
            ]
          },
          {
            "name": "/dev/xvdc",
            "relation_name": null,
            "partition_style": "MBR",
            "size": 10737418240,
            "used_size": 10737418240,
            "device_use": "VOLUME_GROUP",
            "os_disk": false,
            "physical_volumes": []
          }
        ],
        "volume_groups": [
          {
            "name": "vgtest",
            "components": "/dev/xvdb2;/dev/xvdc",
            "size": 16106127360,
            "free_size": 0,
            "logical_volumes": [
              {
                "name": "/dev/mapper/vgtest-data",
                "size": 1073741824,
                "used_size": 3047424,
                "file_system": "ext4",
                "mount_point": "/data",
                "uuid": null,
                "inode_size": 256,
                "block_size": 0,
                "block_count": 0
              }
            ]
          }
        ],
        "networks": [
          {
            "name": "eth0",
            "ip": "192.168.0.151",
            "netmask": null,
            "gateway": null,
            "mtu": 0,
            "mac": "fa:16:3e:35:97:71"
          }
        ],
        "checks": [
          {
            "id": 6463,
            "params": [
              ""
            ],
            "name": "OS_VERSION",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6470,
            "params": [
              ""
            ],
            "name": "CPU",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6477,
            "params": [
              ""
            ],
            "name": "MEMORY",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6484,
            "params": [
              ""
            ],
            "name": "PARAVIRTUALIZATION",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6491,
            "params": [
              ""
            ],
            "name": "FIRMWARE",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6498,
            "params": [
              ""
            ],
            "name": "BOOT_LOADER",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6505,
            "params": [
              ""
            ],
            "name": "RSYNC",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6512,
            "params": [
              ""
            ],
            "name": "RAW_DEVICES",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6519,
            "params": [
              ""
            ],
            "name": "DISK_INFO",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6526,
            "params": [
              ""
            ],
            "name": "PARTITION_STYLE",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          },
          {
            "id": 6533,
            "params": [
              ""
            ],
            "name": "FILE_SYSTEM",
            "result": "OK",
            "error_code": null,
            "error_params": ""
          }
        ],
        "init_target_server": {
          "disks": [
            {
              "name": "/dev/xvda",
              "size": 42949672960,
              "used_size": 42948606976,
              "device_use": "NORMAL",
              "physical_volumes": [
                {
                  "uuid": null,
                  "index": 0,
                  "name": "/dev/xvda1",
                  "device_use": "NORMAL",
                  "file_system": "ext3",
                  "mount_point": "/",
                  "size": 42948606976,
                  "used_size": 2853855232
                }
              ]
            },
            {
              "name": "/dev/xvdb",
              "size": 10737418240,
              "used_size": 6442450944,
              "device_use": "NORMAL",
              "physical_volumes": [
                {
                  "uuid": null,
                  "index": 0,
                  "name": "/dev/xvdb1",
                  "device_use": "NORMAL",
                  "file_system": "swap",
                  "mount_point": "",
                  "size": 1073741824,
                  "used_size": 1073741824
                },
                {
                  "uuid": null,
                  "index": 0,
                  "name": "/dev/xvdb2",
                  "device_use": "VOLUME_GROUP",
                  "file_system": "LVM2_member",
                  "mount_point": "",
                  "size": 5368709120,
                  "used_size": 5368709120
                }
              ]
            },
            {
              "name": "/dev/xvdc",
              "size": 10737418240,
              "used_size": 10737418240,
              "device_use": "VOLUME_GROUP",
              "physical_volumes": []
            }
          ]
        }
      }

Status Code

For details about the status code, see Status Code.

Error Code

For details, see Error Code.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel