Updated on 2026-02-12 GMT+08:00

Migrating a Linux Server

Scenarios

Server Migration Service (SMS) is a P2V/V2V migration service that helps you migrate x86 physical servers or VMs in on-premises, private, or public cloud environments to Huawei Cloud. You can use Elastic Cloud Servers (ECSs) or Flexus instances as the target servers.

This section describes how to quickly create a task for migrating a Linux server on the SMS console.

Procedure

Step

Description

Preparations

  • Sign up for a HUAWEI ID, enable Huawei Cloud services, and top up your account.
  • Obtain the required permissions for the source and target accounts.
  • Obtain an AK/SK pair for the target account.
  • Configure the migration network and security group rules.
  • Check the source server environment and available space.

Step 1: Install and Start the Agent on the Source Server

Install and start the Agent on the source server.

Step 2: Configure the Target Server

Configure the target server on the SMS console.

Step 3: Start Full Replication

Replicate all data from the source server to the target server.

Step 4: Synchronize Incremental Data

Synchronize incremental data from the source server to the target server.

Step 5: Clear Resources

After the migration is complete, delete the cutover and synchronization snapshots generated during the migration to stop further billing.

Preparations

Before using SMS, complete the following preparations:

  1. Register a HUAWEI ID and enable Huawei Cloud services.

    Real-name authentication is required for migrating servers to regions within the Chinese mainland.

  2. Obtain the required permissions.

    If you use a Huawei Cloud account for migration, you have the required permissions by default. If you use an IAM user for migration, you need to obtain the required permissions. For more information, see Creating a User Group and Assigning Permissions.

  3. Obtain an AK/SK pair for your target account.

    The AK/SK pair is used for authentication during the migration. To learn how to obtain an AK/SK pair, see How Do I Obtain an AK/SK Pair for an Account? or How Do I Obtain an AK/SK Pair for an IAM User?

    SMS does not support AK/SK-based authentication for federated users (virtual users).

  4. Ensure that the source server OS is supported by SMS.

    See Supported Linux OSs.

  5. Ensure that the following network requirements are met:
    1. The source server can connect to the Huawei Cloud API Gateway over port 443. For more information, see Connecting the Source Server to Huawei Cloud API Gateway.

      It is recommended that all outbound ports on source servers be opened.

    2. If you want to migrate over an IPv6 network, the source server must support IPv4/IPv6 dual-stack networks.
    3. The source server can connect to the target server. For more information, see Connecting the Source Server to the Target Server.
      • To migrate over the Internet, purchase an EIP in the target region.
      • To migrate over a private network, request a Direct Connect or VPN connection.
    4. The required ports are enabled in a security group the target server belongs to.
      • Port 22 is required for a Linux file-level migration.
      • Ports 8900 and 22 are required for a Linux block-level migration.

      For more information, see How Do I Configure Security Group Rules for Target Servers?

      • For security purposes, you are advised to only allow traffic from the source server to the target server over these ports.
      • The firewall of the target server must allow traffic to these ports.
  6. Ensure that the following source server requirements are met:
    • The available space of the root partition on the source server must be at least 200 MB. If this condition is not met, the source server cannot be migrated.
    • The system time of the source server must be consistent with the local standard time to avoid Agent registration failures.
    • The rsync library is installed on the source server. Rsync comes pre-installed in the mainstream systems by default. You can run the following command on the source server to check whether rsync is installed:
      rsync -v
      If rsync is not installed, install it using the command that matches the source server OS:
      • CentOS:
        yum -y install rsync
      • Ubuntu:
        apt-get -y install rsync
      • Debian:
        apt-get -y install rsync
      • SUSE:
        zypper install rsync
      • For other distributions, refer to the official website documentation.

Step 1: Install and Start the Agent on the Source Server

Download the Agent from the SMS console, install it on the source server, and start the Agent. Enter the AK/SK pair for the Huawei Cloud account that you are migrating to and the SMS domain name. After the Agent is started, it reports information about the source server to SMS.

  1. Sign in to the SMS console.
  2. In the navigation pane on the left, choose Agents.
  3. Select the Linux card, and in the Linux Agent area, click the icon next to Agent URL to copy the Agent download command. Run the command on the source server to download the Agent installation package.

  4. Copy and run the commands to download the CMS and CRL files to the Linux source server, then verify the integrity of the Agent installation file. For details, see How Do I Verify the Integrity of the Agent Installation File?

  5. Decompress the SMS-Agent software package.

    tar -zxvf SMS-Agent.tar.gz

  6. Switch to the SMS-Agent directory on the source server.

    cd SMS-Agent

  7. If you need to use an HTTP/HTTPS proxy, go to 8.

    If you do not need to use an HTTP/HTTPS proxy, go to 9.

    • If your source server cannot access Huawei Cloud over the Internet, you can use a proxy server. You will need to configure the proxy server yourself.
    • In a migration over a private line or VPN, a proxy server is only used for registering the source server with SMS. It is not used for data migration.

  8. (Optional) Configure the HTTP/HTTPS proxy for the Agent.

    1. Go to the config directory.
      cd SMS-Agent/agent/config
    2. Open and edit the auth.cfg file. Do not edit the auth.cfg file unless you need to use an HTTP/HTTPS proxy.
      vi auth.cfg

      The values shown here are for reference only.

      [proxy-config]
      enable = true
      proxy_addr = https://<your-proxy-address>.com
      proxy_port = 3128
      proxy_user = root
      use_password = true
      • enable: To use a proxy, set it to true.
      • proxy_addr: Replace <your-proxy-address> with the IP address of the proxy server, not that of the target server. Use the protocol configured for the proxy. HTTPS is recommended.
      • proxy_user: Enter the username required for the proxy. If no username is required, leave it blank.
      • use_password: If a password is required for the proxy, set it to true. If no password is required, set it to false.
    3. Save the auth.cfg file and exit.
      :wq

  9. Start the SMS-Agent.

    ./startup.sh

  10. Read the displayed information carefully, enter y, and press Enter.

    Figure 1 Entering y

  11. Enter the AK/SK pair for the Huawei Cloud account that you are migrating to and the SMS domain name. You can obtain the SMS domain name on the Agents page of the SMS console, as shown in Figure 3.

    Figure 2 Entering the AK/SK pair
    Figure 3 Obtaining the SMS domain name

    If the EPS service has been enabled for your Huawei Cloud account, after you entered the AK/SK pair, the Agent will list all enterprise projects your account is allowed to access. You can select the enterprise project you would like to migrate the source server to. This enables you to isolate permissions, resources, and finance during the migration. For details, see Migrating a Server into an Enterprise Project.

    When the information shown in the figure below is displayed, the SMS-Agent has been started up and will automatically start reporting source server information to SMS. You can go to the Servers page on the SMS console to view the record of the source server.
    Figure 4 Agent running

Step 2: Configure the Target Server

You can configure the target server on the SMS console only if the source server meets the following conditions:

  • The source server is Connected to SMS.
  • The migration is in the Migration Feasibility Check stage.
  • The migration is in the Pending target configuration status.
  1. Sign in to the SMS console.
  2. In the navigation pane on the left, click Servers.
  3. In the server list, locate the source server to be migrated, and click Configure Target in the Migration Stage/Status column or choose More > Configure Target in the Operation column.

    If the source server record is not found in the server migration list, see Why Wasn't My Source Server Added to the SMS Console After I Configured the Agent?

  4. On the Configure Basic Settings page, configure parameters by referring to Table 1.

    Table 1 Parameter description

    Parameter

    Sub-Parameter

    Description

    Target Region

    -

    Select the region for the target server.

    Target Port

    -

    By default, ports 22 and 8900 are enabled for Linux.

    NOTE:

    Open ports are used for the following purposes:

    • Port 22: The initialization port of the transmission link. It is used to establish the transmission channel and can be modified in some regions.
    • Port 8900: The port for transmitting data. It cannot be modified.

    Network Type

    Public

    (Default) Migration over the Internet requires that the target server has an EIP bound.

    Private

    A Direct Connect connection, VPN connection, VPC peering connection, VPC subnet, or Cloud Connect connection must be provisioned. The private IP address of the target server will be used for migration.

    For details about the network scenarios and solutions for migration over a private network, see Setting Up an SMS Migration Network Using VPN, Direct Connect, and Cloud Connect.

    IP Version

    IPv4

    IPv4 is used for data migration by default.

    IPv6

    On a dual-stack network, IPv6 can be used for migration. For details about migration over IPv6, see Migrating Servers over an IPv6 Network.

    CAUTION:

    If IPv6 is selected, you can only select an existing server as the target end, instead of creating one.

  5. Configure target server specifications. There are two methods for configuring target servers.

    • Use existing: Select a server created on Huawei Cloud as the target server.

      To ensure that the target server can start properly after the migration is complete, its disks will be formatted, and its registry and network settings will be updated. You are advised to back up data before the migration.

      In the list of existing servers, select one that meets the specifications requirements displayed in the Recommended Target row. If no existing server meets the requirements, click Elastic Cloud Server (ECS) above the list and purchase an ECS based on the recommended specifications. For details, see Purchasing an ECS in Custom Config Mode.

    • Create new: SMS automatically purchases a target server based on the configured specifications.

      If you select Create new, the system automatically recommends server specifications, including the server name, AZ, VM specifications, disk information, EIP, VPC, subnet, and security group. You can modify these settings as needed.

      • If you select Recommend for Server Template, the system automatically creates the AZ, instance specifications, disk type, VPC, subnet, and security group during the migration. You can adjust the settings.
        • If Create new is selected for VPC, the system automatically creates a VPC for the target server based on the following rules:

          If the source server's IP address is 192.168.X.X, the system creates a VPC and a subnet that both belong to network range 192.168.0.0/16.

          If the source server's IP address is 172.16.X.X, the system creates a VPC and a subnet that both belong to network range 172.16.0.0/12.

          If the source server's IP address is 10.X.X.X, the system creates a VPC and a subnet that both belong to network range 10.0.0.0/8.

        • If Create new is selected for Security Group, the system automatically creates a security group for the target server and allows traffic to the target server over certain ports:

          Windows: ports 8899, 8900, and 22

          Linux: port 22 for file-level migration

          Linux: ports 8900 and 22 for block-level migration

      • If you select Custom Template for Server Template, the system automatically sets the AZ, instance specifications, disk type, VPC, subnet, and security group based on the template. You can adjust the settings. For details about how to create a custom template, see Creating a Server Template.
      • Configure advanced disk settings.
        • Data disks must be either VBD or SCSI. VBD is the default device type for data disks. For details about disk device types, see Device Types.
        • Data disks can be created as shared disks. For details about shared disks, see Managing Shared EVS Disks.
        • For target servers newly created by the system, system and data disks can be encrypted. For details about shared disks, see Managing Shared EVS Disks. To enable disk encryption, you need to create an agency to authorize EVS to access KMS. After the authorization is successful, set KMS Encryption to one of the following values:
          • Select an existing key

            Select a key from the drop-down list. You can select one of the following keys:

            Default keys: After the KMS access permissions have been granted to EVS, the system automatically creates a default key and names it evs/default.

            Custom keys: You can choose an existing key or create one. For details about how to create a key, see Creating a Key.

          • Enter a key ID

            Enter the ID of a key shared from another user. Ensure that the key is in the target region. For details, see Creating a Grant.

          • Before the migration is complete, do not disable or delete the key used, or the migration will fail.
          • The encryption attribute of a disk cannot be modified after the disk is created.
          • Keys can be shared with accounts, not IAM users.
          • If KMS encryption is used, you will be billed for what you use beyond the free quota given by KMS. For details, see DEW Billing Overview.

    For details about the requirements on target servers, see Target Server Requirements.

  6. (Optional) Set the resource limits.

    Set the parameters according to Table 2.

    Table 2 Resource limit parameters

    Parameter

    Description

    CPU Limit

    These options are only available for Linux migrations. For details, see How Do I Limit Resource Allocation for the Agent in a Linux Migration?

    Memory Limit

    Disk Throughput Limit

    Migration Rate Limit

    You can limit the migration rate based on the source bandwidth and service requirements. If you do not want to limit the migration rate, set this parameter to 0.

    Traffic limiting is unavailable if:

    • The migration uses an IPv6 network.
    • Traffic Control (TC) is missing from the source server.
    • The TC module is available, but the Class-Based Queuing (CBQ) or Hierarchy Token Bucket (HTB) module is missing.

    Overrate Threshold (%)

    You can regulate how much the migration rate can exceed the configured limit. If the migration rate exceeds the threshold multiple consecutive times, the migration task is automatically paused.

    For example, if the migration rate limit is set to 10 Mbit/s and the overrate threshold is set to 10%, the task is automatically paused when the migration rate exceeds 11 Mbit/s (110% of the limit) multiple times consecutively.

    CAUTION:

    This option is only available for Linux migrations. It will not be available or applied if:

    • The migration uses an IPv6 network.
    • Traffic Control (TC) is missing from the source server.
    • The TC module is available, but the Class-Based Queuing (CBQ) or Hierarchy Token Bucket (HTB) module is missing.
    • The installed SMS-Agent is earlier than 24.9.0.

  7. Enable the migration drill.

    Migration drills help you fully assess the feasibility and identify potential risks of a migration task beforehand. The system verifies if security group ports are set correctly, domains connect normally, and necessary permissions are available. If issues are identified, the system offers fixes to minimize risks and disruptions during migration.

    After this function is enabled, the system automatically launches a migration drill before starting the full replication. The entire migration drill takes 5 to 15 minutes, and pay-per-use resources incur costs during this period. For details, see Billing. A migration drill does not transmit source data, so the fee incurred in the drill is low.

    You can review the drill results in the task details. For details, see Checking the Migration Drill Status and Report.

  8. Configure migration parameters.

    Set the parameters according to Table 3.

    Table 3 Migration settings

    Parameter

    Sub-Parameter

    Description

    Start Target Upon Launch

    No

    The target server will be stopped after the migration is complete.

    Yes

    The target server will be started after the migration is complete.

    Migration Method

    Linux block-level

    Migration and synchronization are performed by block. This method is efficient, but the compatibility is poor.

    Linux file-level

    Migration and synchronization are performed by file. This method is inefficient, but the compatibility is excellent. File-level migration is used by default for Linux OSs.

    Enable Concurrency

    Automatic

    The SMS-Agent automatically configures the maximum number of migration processes allowed based on source server conditions.

    Manual

    You can specify the maximum number of processes that the SMS-Agent can start concurrently for migration and synchronization tasks, respectively.

    This option is only available for Linux file-level migrations. For more information, see How Do I Set the Number of Concurrent Processes for a Linux File-Level Migration?

    Enable Continuous Synchronization

    -

    Disabled: After full replication is complete, the system automatically starts the target server without synchronizing incremental data from the source server. You need to choose More > Synchronize in the Operation column to synchronize incremental data to the target server.

    Enabled: After full replication is complete, the system automatically starts to synchronize incremental data from the source end to the target end periodically. In this case, the target server is not started and cannot be operated. To exit this phase, click Start Target in the Migration Stage/Status column of the migration task to start the target server.

    Verify Data Consistency

    -

    Disabled: Data consistency is not verified after full replication is complete. You can choose whether to perform data consistency check during incremental synchronization.

    Enabled: Data consistency is automatically verified after full replication is performed. This is a quick verification, and only the file size and last modification time will be verified. You can modify the verification policy when you launch an incremental synchronization. Note that consistency verification cannot be performed for servers with Btrfs file systems. The following describes the parameters for data consistency verification:

    • Enable Hash Verification: If this option is enabled, the system will generate and compare hash values for each file to be verified. Hash verification is recommended when individual files are large and important. Enabling this option will increase CPU and disk I/O overheads for the source server and extend the verification time.
      CAUTION:
      • Hash values cannot be calculated for files in use, so these files will be skipped during the verification.
      • Enabling this option requires you to specify the verification scope, and only files in the specified scope will be verified.
    • Verification Scope
      • Under Exclude paths, enter the paths you want to exclude from the verification. A maximum of 30 paths can be entered. Use commas (,) to separate the paths. For example, /root/data,/var. Leaving it empty will initiate a full verification.
      • Under Include paths, enter the paths you want to verify.
    CAUTION:
    • If the entered paths are incorrect or empty, 0 will be displayed for them in the verification results.
    • The more data you need to verify, the longer the verification will take. It is wise to narrow the verification scope to only key paths.
    • The following paths will be excluded from consistency verification by default:
      • Linux: /bin, /boot, /dev, /home, /etc, /lib, /media, /proc, /sbin, /selinux, /sys, /usr, /var, /run, and /tmp
      • Windows: top-level directories of partitions, for example, C:\ and O:\

      If you need to include any of the preceding excluded paths in the verification, refer to Modifying the Default Excluded Paths.

    Resize Disks and Partitions

    -

    Disabled: The number of disks and partition size of the target server are the same as those of the source server.

    Enabled: You can adjust the number of target disks and partition size. For details, see Resizing Disks and Partitions on Linux.

    Transit IP Address

    -

    This parameter is available only for private line migration. It is used to set the transit IP address of the target server. For details about how to configure the network in this scenario, see For a Scenario Where the Source Server Has No Internet Access and Cannot Communicate with the Target Server.

  9. Save the settings and start migration.

    After configuring the target server settings, review them in the summary panel and choose whether to start the migration now or later.

    • Saving the settings and start the task immediately:
      1. Click Save and Start.
      2. In the displayed dialog box, read the migration conditions and click OK. Return to the migration server list. The task status becomes Running, indicating that the migration has started.
    • Saving the settings and start the task later:
      1. After you confirm that the settings are correct, click Save.
      2. In the displayed dialog box, read the migration conditions and click OK. Return to the migration server list. The task status becomes To be started, indicating that the migration is not started.

        To start the migration, click Start in the Migration Stage/Status column.

Step 3: Start Full Replication

A full replication replicates all data from the source server to the target server. The replication speed depends on the outbound bandwidth of the source server or the inbound bandwidth of the target server, whichever is smaller.

  1. Locate the source server and click Start in the Migration Stage/Status or Operation column. In the displayed Start Migration window, click OK to start a full replication.

    You can also select the source server and click Start above the server list. In the displayed Start Migration window, click OK.
    Figure 5 Starting a full replication

    During the full replication, the target server stays locked to prevent any operations. After the migration is complete, it will be automatically unlocked.

  2. Click the source server name to view the migration progress.

    • If Enable Continuous Synchronization is set to No when you defined the migration task, the system automatically launches the target server after the full replication is complete. If Finished and Migration completed show in the Migration Stage/Status column, the target server has been launched.
    • If Enable Continuous Synchronization is set to Yes when you defined the migration task, the task stage and status change to continuous sync after the full replication is complete. In this state, the system automatically synchronizes any new or modified disk data from the source server to the target server. If you want to stop continuous synchronization and launch the target server, perform operations described in Launching a Target Server.

Step 4: Synchronize Incremental Data

After the target server is launched, if there are data changes on the source server, you can synchronize the incremental data to the target server.

The data changes on the target server will be overwritten by the data synchronized from the source server. For details, see Will an Incremental Synchronization Overwrite the Existing Data on a Launched Target Server?

  1. In the server list, locate the source server you want to synchronize, and click Sync above the list, or choose More > Sync in the Operation column.
  2. In the Sync Incremental Data dialog box, carefully read the tips and enable Verify Data Consistency if needed. For details about this option, see How Do I Verify Data Consistency Between the Source and Target Servers? Then click OK.

Step 5: Clear Resources

After the migration is complete, if you confirm that no additional incremental synchronizations are required, you can delete the snapshots generated for cutover and synchronization during the migration.

Once these snapshots are deleted, incremental data synchronization will no longer be possible. Confirm that no additional synchronizations are required before performing this action.

  1. Select a server whose task status is Completed and for which incremental synchronization is no longer required. Click Delete Resources in the Migration Stage/Status column.

    Figure 6 Deleting resources

  2. In the displayed Delete Resources dialog box, enter DELETE in the text box or click Auto Enter and then click OK.

    Figure 7 Confirm the deletion

Resizing Disks and Partitions on Linux

The restrictions on resizing Linux disks and partitions are as follows:

  • For a Linux server using LVM, you can choose whether to migrate specific physical or logical volumes and resize the paired target volumes.
  • Partition resizing is not available for Btrfs partitions on Linux.
  • For a Linux server, the system and swap partitions are migrated by default.
  • You can choose to migrate all or none volume groups by using the Migrate All Volume Groups option.
  • If you choose to migrate none of the logical volumes in a volume group, their physical volumes will not be migrated by default.
  • In a Linux block-level migration, you can upsize partitions, but you cannot downsize them.
  • In a Linux file-level migration, you can upsize or downsize partitions. When you downsize a partition, the new partition size must be at least 1 GB larger than the used partition space. If the current size does not meet this condition, downsizing is not possible. For details, see What Are the Rules for Resizing Volume Groups, Disks, and Partitions?
  1. In the Migration Settings area, enable Resize Disks and Partitions and click Resize Disks and Partitions.
  2. Configure volume groups.

    • If the source server uses LVM, you can resize logical and physical volumes.
    • If the source server does not use LVM, skip this step.

  3. Click Next: Configure Disks.
  4. Click Resize Disk and adjust the size of each disk as required. As shown in Resizing disks and partitions on Linux, you can view the resized disks at the bottom of the window.

    • If the total partition size after resizing is larger than the disk size, you need to expand the disk capacity to fit the partition size.
    • If the total partition size after resizing is much smaller than the disk size, you can downsize the disk.
    Figure 8 Resizing disks and partitions on Linux

  5. Click Next: Confirm. Confirm the configurations and click OK.

    After you click OK, disk and partition resizing can no longer be disabled for this task. If you want to restore the original disk and partition settings, locate the source server and choose More > Delete in the Operation column. Then restart the Agent on the source server, and configure the target server again.

Checking the Migration Drill Status and Report

If Migration Drill is enabled when you configure a migration task, you can check the migration drill status and report.

  1. In the server list, click the name of the source server to expand the migration task details.
  2. On the Task Progress tab, check the status and progress of the migration drill.

  3. In the upper part of the task details page, click View Report next to Drill Status. In the report displayed on the right, check the drill details, check items, and check results.

Helpful Links

If an error is reported during the migration, rectify the fault by referring to Error Codes and Solutions.