Updated on 2025-08-19 GMT+08:00

Importing Details of Cloud Resources

You can import CSV-formatted resource details from Alibaba Cloud directly into MgC. You first need to export the resource details from Alibaba Cloud. After the import is complete, you can view the resource details on the MgC console. With the imported details, you can get recommendations for suitable Huawei Cloud resources.

Exporting Resource Details Using the Alibaba Cloud Console

The supported Alibaba Cloud resources are:

  • Elastic Compute Service (ECS) instances and cloud disks
  • Object Storage Service (OSS) buckets
  • ApsaraDB RDS for MySQL instances
  • ApsaraDB RDS for Redis instances
  1. Sign in to the Alibaba Cloud ECS console.
  2. On the Overview page, choose Export Data > Instances to export a list of all ECS instances.

  3. Choose Export Data > Disks to export a list of all cloud disks.
  4. Open the instance list and the disk list and adjust the resource information if needed. Ensure that the lists contain the necessary information.

    List

    Mandatory Fields

    Instance list

    Instance ID, OS, instance specifications, CPU, and memory

    Disk list

    Instance ID, disk ID, capacity (GiB), and disk attributes

  1. Sign in to the OSS console.
  2. In the navigation pane, choose Buckets.
  3. Click the icon in the upper right corner of the list. The Export Bucket List dialog box is displayed.

  4. Select the information to be exported and click OK.
  1. Sign in to the Alibaba Cloud ApsaraDB RDS for MySQL console.
  2. In the navigation pane on the left, choose Instances. Select a region in the upper part of the page.
  3. Filter all MySQL instances in the Database Engine column and click the icon in the upper right corner of the list.

  4. In the displayed dialog box, select the information to be exported. Click OK. The system exports the instance information to a CSV file and automatically downloads the file.
  5. Modify the exported CSV file so MgC can parse the file content.

    1. Use a file editor to open the CSV file and search for PrivatePort(A network port,) in the table header.
    2. Delete the comma (,) from this field and save the file. The correct format is PrivatePort(A network port).

  1. Sign in to the Alibaba Cloud ApsaraDB for Redis console.
  2. In the navigation pane on the left, choose Instances. Select a region in the upper part of the page.
  3. In the lower left corner of the page, expand and click Select All.

  4. Click the icon in the upper right corner of the list. In the dialog box that is displayed, select the information to be exported.

  5. Click OK. The system exports the instance information to a CSV file and automatically downloads the file.
  6. Modify the exported CSV file so MgC can parse the file content.

    1. Use a file editor to open the CSV file.
    2. Add a comma (,) at the end of the table heading line and save the file.

      The following shows an example table header before modification:

      ID,Name,Quantity

      The following shows the table header after modification:

      ID,Name,Quantity,

Exporting Resource Details Using Alibaba Cloud Resource Management

You can export the details of all resources, server resources, or database resources.

  1. Sign in to the Alibaba Cloud Resource Management console.
  2. In the navigation pane on the left, choose Resource Center > Advanced Search.
  3. In the search box on the right of the page, enter SQL statements in the Temporary Query 1 box. Alternatively, click the plus sign (+) to open a new tab and write query statements. Use the following SQL statements for query:

    SELECT
      resource_type,
      resource_id,
      resource_name,
      region_id,
      zone_id,
      create_time,
      resource_group_id,
      tags,
      ip_addresses,
      vpc_id,
      v_switch_id,
      properties
    FROM
      resources
    ORDER BY
      region_id,
      resource_type,
      resource_id

  4. Click Run.
  5. Click the Query Result tab to view the query results.
  6. Export the query results to a CSV file and save the file to the local PC. Click the download button on the right and set Format to Close on the Report Settings page.

  1. Sign in to the Alibaba Cloud Resource Management console.
  2. In the navigation pane on the left, choose Resource Center > Advanced Search.
  3. In the search box on the right of the page, enter SQL statements in the Temporary Query 1 box. Alternatively, click the plus sign (+) to open a new tab and write query statements. Use the following SQL statements for query:

    SELECT
      resource_type,
      resource_id,
      resource_name,
      region_id,
      zone_id, 
      create_time, 
      resource_group_id,
      ip_addresses,
      tags,
      vpc_id,
      v_switch_id,
      properties ->> 'InstanceId' as instance_id,
      properties ->> 'CreditSpecification' as credit_specification,
      properties ->> 'OSName' as os_name,
      properties ->> 'HostName' as host_name,
      properties ->> 'Status' as status,
      properties ->> 'Description' as description,
      properties ->> 'InstanceType' as instance_type,
      properties ->> 'InstanceTypeFamily' as instance_type_family,
      properties ->> 'ImageId' as image_id,
      properties ->> 'Cpu' as cpu,
      properties ->> 'Memory' as memory,  
      properties -> 'PublicIpAddress' ->> 'IpAddress' as public_ip_address,
      properties -> 'VpcAttributes' -> 'PrivateIpAddress' ->> 'IpAddress' as private_ip_address,
      properties -> 'EipAddress' ->> 'IpAddress' as eip_address_ip,
      properties -> 'EipAddress' ->> 'Bandwidth' as bandwidth, 
      properties ->> 'ExpiredTime' as expired_time,
      properties -> 'SecurityGroupIds' ->> 'SecurityGroupId' as security_group_id,
      properties ->> 'Size' as disk_size,
      properties ->> 'DeleteWithInstance' as delete_with_instance,
      properties ->> 'DeleteAutoSnapshot' as delete_auto_snapshot,
      properties ->> 'Type' as disk_type,
      properties ->> 'Encrypted' as disk_encrypted,
      properties ->> 'DetachedTime' as disk_detached_time,
      properties ->> 'AutoSnapshotPolicyId' as auto_snapshot_policy_id,
      properties ->> 'IOPS' as iops,
      properties ->> 'IOPSRead' as iops_read,
      properties ->> 'IOPSWrite' as iops_write,
      properties ->> 'PerformanceLevel' as performance_level,
      properties ->> 'SourceSnapshotId' as disk_source_snapshot_id
    FROM
      resources 
    WHERE
      resource_type = 'ACS::ECS::Instance' OR resource_type = 'ACS::ECS::Disk'

  4. Click Run.
  5. Click the Query Result tab to view the query results.
  6. Export the query results to a CSV file and save the file to the local PC. Click the download button on the right and set Format to Close on the Report Settings page.

  1. Sign in to the Alibaba Cloud Resource Management console.
  2. In the navigation pane on the left, choose Resource Center > Advanced Search.
  3. In the search box on the right of the page, enter SQL statements in the Temporary Query 1 box. Alternatively, click the plus sign (+) to open a new tab and write query statements. Use the following SQL statements for query:

    SELECT
      resource_type,
      resource_id,
      resource_name,
      region_id,
      zone_id, 
      create_time, 
      resource_group_id,
      ip_addresses,
      tags,
      vpc_id,
      v_switch_id,
      properties ->> 'InstanceId' as instance_id,
      properties ->> 'DBInstanceDescription' as description,
      properties ->> 'DBInstanceType' as db_instance_type,
      properties ->> 'DBInstanceClass' as db_instance_class,
      properties ->> 'DBInstanceClassType' as db_instance_class_type,
      properties ->> 'Category' as category,
      properties ->> 'DBInstanceCPU' as db_instance_cpu,
      properties ->> 'DBInstanceMemory' as db_instance_memory,
      properties ->> 'MaxIOPS' as max_iops,
      properties ->> 'DBInstanceStorage' as db_instance_storage,
      properties ->> 'Engine' as engine,
      properties ->> 'EngineVersion' as engine_version,
      properties ->> 'InstanceNetworkType' as instance_network_type,
      properties ->> 'PayType' as pay_type,
      properties ->> 'ExpireTime' as expire_time,
      properties ->> 'MaxConnections' as max_connections
    FROM
      resources
    WHERE
      resource_type = 'ACS::RDS::DBInstance'

  4. Click Run.
  5. Click the Query Result tab to view the query results.
  6. Export the query results to a CSV file and save the file to the local PC. Click the download button on the right and set Format to Close on the Report Settings page.

Importing Details of Cloud Resources

You can import data exported from Resource Management or cloud services.

  1. Sign in to the MgC console. In the navigation pane, under Project, select an application migration project from the drop-down list.
  2. In the navigation pane, choose Source Resources.
  3. Click the Import tab. Then click the Import card.

    Figure 1 Import

  4. Click the Cloud resources option, select the source cloud platform, choose the resource type to be imported from the Resource Category drop-down list, and upload the corresponding resource list.

    Figure 2 Selecting a resource type

    Only CSV files encoded in UTF-8 format with English table headers can be imported. The size of a single file cannot exceed 50 MB. For details about how to convert the encoding format of a CSV file to UTF-8, see How Do I Convert the Encoding Format of a CSV File to UTF-8?

    Resource Type

    Procedure

    All

    Click Add under Resource List and select the exported resource list.

    Server

    Click Add under Resource List and select the exported server list.

    Database

    Click Add under Resource List and select the exported database list.

  5. Click Confirm. The Task Center page is displayed. After the resource list is uploaded, return to the Source Resources page and view the imported resources on the corresponding tab.
  1. Sign in to the MgC console. In the navigation pane, under Project, select an application migration project from the drop-down list.
  2. In the navigation pane, choose Source Resources.
  3. Click the Import tab. Then click the Import card.

    Figure 3 Import

  4. Click the Cloud resources option, select the source cloud platform, choose the resource type to be imported from the Resource Category drop-down list, and upload the corresponding resource list.

    Figure 4 Selecting a resource type

    Only CSV files encoded in UTF-8 format with English table headers can be imported. The size of a single file cannot exceed 50 MB. For details about how to convert the encoding format of a CSV file to UTF-8, see How Do I Convert the Encoding Format of a CSV File to UTF-8?

    Resource Type

    Procedure

    Server

    1. Click Add under Resource List and select the exported ECS list.
    2. Click Add under Cloud Disk List and select the exported disk list.

    Redis

    Click Add under Resource List and select the exported Redis instance list.

    Object storage

    Click Add under Resource List and select the exported OSS bucket list.

    Database

    Click Add under Resource List and select the exported RDS for MySQL instance list.

  5. Click Confirm. The Task Center page is displayed. After the resource list is uploaded, return to the Source Resources page and view the imported resources on the corresponding tab.