All Products
Search
Document Center

Elastic Compute Service:Migrate and upgrade the operating system of an ECS instance

Last Updated:Oct 20, 2023

The technical support for operating systems of Elastic Compute Service (ECS) instances may be discontinued for reasons such as end of life (EOL), end of third-party support, and evolution of open-source projects. If you need future technical support for your operating system, migrate your instance to or upgrade the instance image to an image that has long-term support (LTS). This topic describes how to migrate and upgrade an operating system in the ECS console.

Prerequisites

  • Resource Access Management (RAM) is activated, and Server Migration Center (SMC) is granted the permissions required to access cloud resources.

    Log on to the RAM console and click Confirm Authorization Policy.

    Note

    If you are using a RAM user, log on to the RAM console with the corresponding Alibaba Cloud account and grant the AliyunSMCFullAccess permission to the RAM user.

  • The snapshot service is activated. For more information, see Activate ECS Snapshot.

  • The ECS instance that you want to migrate is in the Stopped state. If the ECS instance is not in the Stopped state, stop the instance. For more information, see Stop an instance.

  • The ECS instance that you want to migrate belongs to the current Alibaba Cloud account.

  • Cloud Assistant Agent is installed on the ECS instance and ran within the last 24 hours. For information about how to install Cloud Assistant Agent, see Install Cloud Assistant Agent.

  • No snapshot is being created for the ECS instance.

Background information

On December 8, 2020, CentOS announced that they would be shifting focus from CentOS Linux, the rebuild of Red Hat Enterprise Linux (RHEL), to CentOS Stream. For more information, see CentOS Project shifts focus to CentOS Stream. Alibaba Cloud CentOS Linux public images are derived from CentOS. When the CentOS project ends support for CentOS Linux, Alibaba Cloud also ends support for this Linux distribution. To prevent the impacts of the EOL for CentOS, we recommend that you replace your CentOS operating system at the earliest opportunity.

  • Alibaba Cloud Linux is a Linux distribution that is provided by Alibaba Cloud. Alibaba Cloud Linux is fully compatible with the RHEL and CentOS ecosystems, and includes many optimizations for the Alibaba Cloud platform. Alibaba Cloud provides free LTS for Alibaba Cloud Linux. Alibaba Cloud Linux 2 and Alibaba Cloud Linux 3 public images are provided. For more information, see Overview.

  • Alibaba Cloud Linux 2 will reach its EOL on March, 31, 2024. Alibaba Cloud Linux 2 is an operating system provided by Alibaba Cloud. After the EOL, Alibaba Cloud will continue to provide technical assistance for your Alibaba Cloud Linux 2. However, we recommend that you upgrade to Alibaba Cloud Linux 3 to obtain better user experience and new features such as the support for the AI ecosystem.

  • Anolis OS is an open-source, independent Linux distribution that is released by the OpenAnolis community. Anolis OS is fully compatible with the CentOS 8 ecosystem and other mainstream Linux distributions, and can deliver enterprise-level stability, security, reliability, and high performance. For more information, visit OpenAnolis.

Scenarios

The following table describes the x86-based and Arm64-based source operating systems and destination operating systems that are supported by the operating system migration feature.

Operating system architecture

Source operating system

Destination operating system

x86

CentOS 7

  • Anolis OS 7

  • Anolis OS 8

  • Alibaba Cloud Linux 2

  • Alibaba Cloud Linux 3

CentOS 8

  • Anolis OS 8

  • Alibaba Cloud Linux 3

Alibaba Cloud Linux 2

Alibaba Cloud Linux 3

arm64

CentOS 7

  • Anolis OS 7

  • Anolis OS 8

  • Alibaba Cloud Linux 3

CentOS 8

  • Anolis OS 8

  • Alibaba Cloud Linux 3

Limits

  • Anolis OS and Alibaba Cloud Linux do not provide i686-based software packages. If your CentOS operating system comes with i386- or i686-based software packages, you cannot migrate to Anolis OS or Alibaba Cloud Linux.

  • The operating systems of instances that are created from custom images cannot be migrated.

  • To migrate from CentOS 7 to Alibaba Cloud Linux 2, take note of the following limits:

    Alibaba Cloud Linux 2 uses kernel version 4.19, which is incompatible with kernel version 3.10 in CentOS 7. If your business uses applications that depend on kernel APIs for different purposes, such as building out-of-tree kernel modules and using hardware resources, you must assess these applications beforehand to determine whether they can run as expected after a direct migration.

  • To migrate from CentOS 8 to Alibaba Cloud Linux 3, take note of the following limits:

    Alibaba Cloud Linux 3 uses Linux Kernel 5.10 LTS, and its GNU toolchain contains GCC 10.2, Binutils 2.35, and glibc 2.32. Alibaba Cloud Linux 3 is compatible with the CentOS 8 ecosystem. When you use the migration tool to migrate from CentOS 8 to Alibaba Cloud Linux 3, the migration tool determines which features and software may be limited after the migration. The following table describes the limits.

    Feature or software

    Supported

    Migration affected

    Description

    i386-based software package

    Unsupported.

    Yes

    Alibaba Cloud Linux 3 does not provide i386-based software packages. If your CentOS 8 operating system comes with i386-based software packages, you cannot use the migration tool to migrate to Alibaba Cloud Linux 3. To prevent system exceptions, you must delete the i386-based software packages before you perform an operating system migration.

    epel-modular

    Unsupported.

    No

    The Extra Packages for Enterprise Linux (EPEL) repositories of CentOS 8 and Alibaba Cloud Linux 3 depend on different platforms. You can migrate from CentOS 8 to Alibaba Cloud Linux 3, but you cannot install the software packages that are based on epel-modular after the migration.

    Compatibility with C/C++ programs

    Not guaranteed.

    No

    Alibaba Cloud Linux 3 comes with software packages that are tuned for better compatibility with C/C++ programs. The GNU toolchain of Alibaba Cloud Linux 3 contains GCC 10.2, Binutils 2.35, and glibc 2.32. After you migrate from CentOS 8 to Alibaba Cloud Linux 3, we recommend that you compile and verify your C/C++ programs by using the new GNU toolchain to prevent incompatibility issues.

    Kernel module compatibility

    Unsupported.

    No

    Alibaba Cloud Linux 3 uses Linux Kernel 5.10 LTS. Alibaba Cloud Linux 3 is compatible with the CentOS 8 ecosystem but is not fully compatible with kernel version 4.18 in CentOS 8. If your business uses the applications that depend on kernel APIs for different purposes, such as building out-of-tree kernel modules and using hardware resources, you must assess these applications beforehand to determine whether they can run as expected after a direct migration.

    MySQL database

    Only migrations to the same or later MySQL versions are supported.

    • No if the MySQL version provided by Alibaba Cloud Linux 3 is the same as or later than that provided by CentOS 8

    • Yes if the MySQL version provided by Alibaba Cloud Linux 3 is earlier than that provided by CentOS 8

    Alibaba Cloud Linux 3 supports MySQL. However, MySQL version downgrades are not supported. If the MySQL version provided by Alibaba Cloud Linux 3 is earlier than that provided by CentOS 8, you cannot use the migration tool to migrate from CentOS 8 to Alibaba Cloud Linux 3.

    Operating system hot migration

    Unsupported.

    No

    During the migration procedures, software packages are re-installed. This causes services to restart and results in brief service interruptions. To prevent impacts on services, we recommend that you back up data and isolate the source operating system environment before you use the migration tool to migrate from CentOS 8 to Alibaba Cloud Linux 3. For information about how to back up data, see Snapshot overview.

    The migration tool consumes resources to download and install software packages during migration. Before you perform a migration on an Elastic Compute Service (ECS) instance, make sure that the following resources are available:
    • Amount of memory space: 300 MiB
    • Amounts of disk space available for the following directories:
      • /usr: 250 MiB
      • /var: 1.5 GiB
      • /boot: 50 MiB
    Note If your instance has a smaller number of vCPUs, little memory, and a small amount of storage space (system disk space and data disk space), we recommend that you stop services that are running on the instance before you migrate the instance to Alibaba Cloud Linux 3. This way, you can prevent migration failures caused by insufficient resources.

Usage notes

  • During the migration process, the following operations are performed on the ECS instance: creating snapshots for basic disks, reinstalling software packages, creating a custom image from a system disk snapshot, replacing the system disk, stopping the ECS instance, and starting the ECS instance. After the system disk is replaced, a disk is created as the new system disk. Automatic snapshots that are released along with the original disk are deleted and cannot be restored. We recommend that you back up important data and plan a proper migration time to prevent the preceding operations from affecting your business.

  • During the migration process, do not stop, restart, or release the ECS instance in manual mode or by using O&M scripts.

  • During the migration process, snapshots are created for all disks to back up data. You are charged for snapshots based on the pay-as-you-go billing method. For more information about the billing methods and rules of snapshots, see Snapshots.

  • The migration of an operating system is irreversible. You need to reinstall software packages during the migration process. Before you migrate the operating system of your ECS instance, we recommend that you create snapshots for the ECS instance to back up data. For more information about snapshots, see Snapshot overview.

  • YUM or DNF is used for migration. Make sure that these two components run as expected.

Procedure

Important
  • The operating system migration feature is supported only in the new ECS console.

  • When you migrate the operating system of an ECS instance, snapshots are automatically created for the instance. After you migrate the operating system of the instance, if you no longer need the snapshots, delete the snapshots at the earliest opportunity to prevent additional costs. For more information, see Delete a snapshot. For information about the pricing of snapshots, see Snapshots.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instances.

  3. In the top navigation bar, select the region where the ECS instance is located.image.png

  4. Find the ECS instance that you want to manage and choose More > Disk and Image > Replace Operating System in the Actions column.

    Important

    You cannot migrate the operating systems of multiple instances at a time.

  5. In the Replace Operating System dialog box, select Migrate Operating System.adas56

  6. Read the precautions, select I acknowledge and accept these risks and authorize Alibaba Cloud to create snapshots for all disks on the instance, and then click Continue to Replace Operating System.

  7. In the Replacement Operating System section of the Migrate Operating System dialog box, select the operating system to which to migrate the ECS instance.

    In this example, the ECS instance is migrated from CentOS 7 to Alibaba Cloud Linux 3.

    image.png
  8. Clear If an error occurs during the migration process, the operating system replacement operation is automatically canceled or leave this option selected.

    • If this option is selected, the operating system migration task is automatically canceled when an error occurs during the migration process. The ECS instance remains in the Stopped state. You can migrate the operating system of the instance again.

    • If this option is cleared, OS Replacement Error appears in the Status column of the instance when an error occurs during the migration process. You can move the pointer over OS Replacement Error and click Cancel Operating System Replacement to cancel the operating system migration task. Then, you can migrate the operating system of the instance again.

  9. Click Confirm.

    Approximately 10 minutes are required to migrate the operating system. This excludes the period of time that is required to create snapshots. On the Instances page or the Instance Details page, you can view the progress of the migration task.

    • If the operating system is migrated, the state of the instance changes from Replacing OS to Running.

      Note

      When the operating system is being migrated, you can move the pointer over Replacing OS to view the progress of the migration task.

    • If the operating system fails to be migrated, the instance enters the OS Replacement Error state. You can move the pointer over OS Replacement Error to view the cause of the error. Troubleshoot the issue and then migrate the operating system of the instance again.

What to do next

The operating system migration feature is provided by SMC. For more information, see What is SMC? To view and manage migration records of operating systems, go to the SMC console. You can also perform operating system migrations in the SMC console. For more information, see Create an operating system migration job.