Help Center/ Huawei Cloud Flexus/ Best Practices/ Migrating Servers Using Server Migration Service (SMS)
Updated on 2024-06-17 GMT+08:00

Migrating Servers Using Server Migration Service (SMS)

Application Scenarios

This section describes how to use Server Migration Service (SMS) to migrate other cloud servers to Huawei Cloud FlexusL instances in the same region or across regions.

Precautions

  • Once the migration starts, do not perform operations on the FlexusL instances, including but not limited to stopping the instances, changing the OS, or reinstalling the OS. Otherwise, the migration will be interrupted or fail.
  • If you want to migrate incremental data after the full migration is complete, do not reinstall or change the OS for the FlexusL instances, or the migration will fail.

Constraints

  • Only x86 servers can be migrated to FlexusL instances.
  • SMS migrates entire servers. It cannot only migrate system or data disks of servers.
  • Only servers with one data disk can be migrated. The paired FlexusL instances must have system and data disks at least as large as the source servers.

For more information, see SMS Precautions and SMS Constraints.

Resource Planning and Costs

Resource

Data Planning

Description

Cost

Source server

Server name: source-server

OS: CentOS 7.9

The source server can be in Huawei Cloud, another cloud platform, or an on-premises environment.

If the source server has no EIP bound, you need to configure one for the source server. You need to pay for the EIP.

Target server

Server name: destination_server

OS:

Huawei Cloud EulerOS 2.0

The target server is a Huawei FlexusL instance.

You need to pay for the FlexusL instance.

SMS

-

SMS is available for free.

You need to pay for the pay-per-use migration resources (including EVS disks, EVS snapshots, and traffic) used during the migration. For details, see SMS Billing.

Process

Procedure

Description

Making Preparations

Prepare accounts, obtain required permissions, and prepare source and target servers.

Step 1 Installing and Starting the Agent on the Source Server

Install and start the Agent on the source server. To start the Agent, you must enter the AK/SK pair of the Huawei Cloud account the FlexusL instance belongs to. After the Agent is started, it reports information about the source server to SMS.

Step 2: Configuring the Target Server on the SMS Console

Configure the target server which will receive data migrated from the source server.

Step 3: Starting the Migration

Start the migration to replicate 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.

Step 4: Viewing the Migration Result

Check whether the source server is successfully migrated, and install the one-click password reset plug-ins and the HSS Agent on the target server.

Step 5: Creating a Private Image and Changing the OS of the FlexusL instance

Create a private image for the FlexusL instance and use the image to change the OS for the instance. In this way, the OS name of the FlexusL instance can be displayed in the instance card, and reinstalling the OS for the FlexusL instance will not roll back its OS to that before the migration.

Making Preparations

Prepare accounts, obtain required permissions, and prepare source and target servers.

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

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

  2. Obtain required permissions for your HUAWEI ID.

    If you use an HUAWEI ID 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 will be 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?

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

  4. Note the username and password for logging in to the source server.

    If your source server is not in Huawei Cloud, note the username and password of the source server. The username and password are required when you install the one-click password reset plug-ins on the target server after the migration is complete. If you forget the username and password, the plug-ins installation process will be complex.

  5. Confirm that the source server OS is supported by SMS.
  6. Ensure that the following network requirements are met:
    1. The source server can connect to the Huawei Cloud API Gateway over TCP port 443. For more information, see Connecting Source Servers to Huawei Cloud API Gateway. For details about how to control traffic into and out of a security group, see Adding a Security Group Rule.

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

    2. The source server can connect to the target server. For more information, see Connecting Source Servers to Target Servers.

      In this practice, EIP is used for connection. You need to purchase and configure EIPs for both the source and target servers. A FlexusL instance has an EIP bound by default.

    3. The following ports are enabled in the security group of the target server to allow traffic to these ports:
      • Windows: TCP ports 8899, 8900, and 22
      • Linux: TCP port 22 for file-level migration, and ports 8900 and 22 for block-level migration
      For details about how to control traffic into and out of a security group, see Adding a Security Group Rule.
      • For security purposes, you are advised to only allow traffic from the source servers over these ports.
      • The firewall of the target server must allow traffic to these ports.
  7. Ensure that the following source server requirements are met:

    Available Space

    • Windows: at least 320 MB of available space on a partition not smaller than 600 MB, and at least 40 MB of available space on a partition smaller than 600 MB
    • Linux: at least 200 MB of available space on the root partition

    Source Environment

    • The system time of the source server must be consistent with the local standard time to avoid Agent registration failures.
    • If the source server runs Linux, rsync must be installed on it. You can run the rsync -v command to check whether rsync is installed.
      If it is not, install it by running the following command:
      • CentOS: yum -y install rsync
      • Ubuntu: apt-get -y install rsync
      • Debian: apt-get -y install rsync
      • SUSE: zypper install rsync
      • Other distributions: Refer to the official website documentation.

        rsync comes preinstalled on most distributions by default.

Step 1 Installing and Starting the Agent on the Source Server

FAQ

  1. If an error message indicating that rsync is not installed is displayed when you install Agent on the Linux source server, install rsync based on Installing Rsync and then reinstall the Agent.

  2. If the following error message is displayed, check whether the access key is correctly entered or deleted.
    Figure 1 Error message
    Figure 2 Access key

Step 2: Configuring the Target Server on the SMS Console

  1. Log in to the SMS console using the Huawei Cloud account that owns the FlexusL instance and choose Servers on the left.
  2. On the Servers page, locate the source server to be migrated and click Configure.

    After step 1 is complete, you can see the source server record on the Servers page of the SMS console.

  3. Configure the basic settings.

    Retain the default settings on this page.

    For details about the parameters, see Configuring the Target Server.

  4. Configure the target server and click Next: Confirm in the lower right corner.
    • Region: Select the region where the purchased FlexusL instance is located.
    • Server: Select Use existing and choose the purchased FlexusL instance.
      • Only servers with one data disk can be migrated. The paired FlexusL instances must have system and data disks at least as large as the source servers.
      • The target server must run the same type of OS as the source server.
      • The security group of the target server must be correctly configured. It must be configured to allow access on TCP ports 8899, 8900, and 22 for a Windows migration, or on port 22 for a Linux migration.

    If the following information is displayed when you perform this step, allow traffic over the prompted port, refresh the page, and repeat this step.

  5. On the Confirm page, confirm the information and click Save or Save and Start.

Step 3: Starting the Migration

  1. Log in to the SMS console using the Huawei Cloud account that owns the FlexusL instance and choose Servers on the left.
  2. On the Servers page, locate the source server to be migrated and click Start in the Operation column.

    Alternatively, select the server to be migrated and click Start above the server list.

  3. After the migration starts, click the name of the source server to view the migration status and details.

  4. Check whether the Status changes to Finished. If it changes, the target server has been launched, and the migration is complete.

  5. (Optional) If incremental data is generated on the source server after the full migration is complete, synchronize the incremental data from the source server to the target server.

    If you want to migrate incremental data after the full migration is complete, do not reinstall or change the OS for the target server, or the migration will fail.

Step 4: Viewing the Migration Result

  1. Check the OS on the FlexusL instance.

    Click Remote Login in the FlexusL instance card. If the OS and kernel information of the source server is displayed, the migration is successful.

    Enter the username and password of the source server to log in to the FlexusL instance.

  2. (Optional) Install the one-click password reset plug-in on the FlexusL instance.

    If your source server was not created from a Huawei Cloud image, install the one-click password reset plug-in on the FlexusL instance. With the plug-in, you can reset your instance password.

  3. (Optional) Check the HSS service status.

Step 5: Creating a Private Image and Changing the OS of the FlexusL instance

After the migration is complete, the original OS name (Huawei Cloud EulerOS 2.0) is still displayed in the FlexusL instance card, as shown in figure Figure 4. If you choose to reinstall the OS for the FlexusL instance after the migration is complete, the OS will actually be rolled back to the original OS Huawei Cloud EulerOS 2.0 rather than CentOS 7.9, and the OS data migrated from the source server will be lost.

Create a private image for the FlexusL instance. Then use the image to change the OS for the instance. After the OS is changed, the above two problems can be solved.

If the OS is changed, incremental data on the source server cannot be synchronized. Ensure that no incremental data needs to be synchronized before changing the OS.

Figure 4 Image name of the FlexusL instance
  1. Log in to IMS console, choose Create Image, and configure the following parameters:
    • Region: Retain the default value.
    • Type: Retain the default value.
    • Image Type: Retain the default value.
    • Source: Select the FlexusL instance.
    • Name: Enter an image name that is easy to identify, for example, CentOS 7.9_source-server-image.
    • Agreement: Read the agreements and select the Agreement option.

  2. Click Next, confirm the information, and click Submit.
  3. Go back to the FlexusL console, click the FlexusL instance, and choose Change OS in the upper right corner.

  4. Configure the parameters for changing the OS and click Submit.
    • Select the private image CentOS 7.9_source-server-image created in 1.
    • Stop the instance first or select Stop server on the Change OS page.
    • Read and agree to the agreements.

  5. Check whether the image name on the console is changed.