All Products
Search
Document Center

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

Last Updated:Apr 02, 2024

The technical support for operating systems of Elastic Compute Service (ECS) instances may be discontinued due to reasons such as end of life (EOL), end of third-party support, and evolution of open-source projects. If you require technical support for your operating system in the future, you must migrate or upgrade the operating system. 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 Alibaba Cloud ECS 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.

  • The operating system that you want to migrate is running on an ECS instance within the current Alibaba Cloud account.

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 is optimized for the Alibaba Cloud platform. Alibaba Cloud provides free long-term support (LTS) for Alibaba Cloud Linux. Alibaba Cloud Linux 2 and Alibaba Cloud Linux 3 public images are available. For more information, see What is Alibaba Cloud Linux?.

  • 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 continues to provide technical support for Alibaba Cloud Linux 2. To obtain better user experience and use new features, such as the support for the AI ecosystem, we recommend that you upgrade to Alibaba Cloud Linux 3.

  • 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

Windows

The following table describes the x86-based operating systems that can be migrated by using SMC and the operating systems that can serve as migration destinations.

Operating system architecture

Source operating system

Destination operating system

X86

  • Windows Server 2008 R2 Standard Edition 64-bit (Chinese/English)

  • Windows Server 2008 R2 Enterprise Edition 64-bit (Chinese)

Windows Server 2012 R2 Datacenter Edition 64-bit (Chinese/English)

Important

The language of the destination operating system must be the same as that of the source operating system.

Windows Server 2012 R2 Datacenter Edition 64-bit (Chinese/English)

Windows Server 2016 Datacenter Edition 64-bit (Chinese/English)

Important

The language of the destination operating system must be the same as that of the source operating system.

Linux

The following table describes the x86- or ARM64-based operating systems that can be migrated by using SMC and the corresponding operating systems to which they can be migrated.

Operating system architecture

Source operating system

Destination operating system

x86

CentOS 7

  • AnolisOS 7

  • AnolisOS 8

  • Alibaba Cloud Linux 2

  • Alibaba Cloud Linux 3

CentOS 8

  • AnolisOS 8

  • Alibaba Cloud Linux 3

  • Red Hat 7

    Important

    Only Red Hat 7.9 is supported.

  • Red Hat 8

Alibaba Cloud Linux 3

Alibaba Cloud Linux 2

Alibaba Cloud Linux 3

ARM64

CentOS 7

  • AnolisOS 7

  • AnolisOS 8

  • Alibaba Cloud Linux 3

CentOS 8

  • AnolisOS 8

  • Alibaba Cloud Linux 3

Limits

Migration limits vary based on the operating system.

Windows

  • Cross-language migration of Windows operating systems is not supported.

  • The instance type of the ECS instance whose Windows operating system is to be migrated must have at least 2 vCPUs and 2 GiB of memory.

  • The migration tool consumes resources to download and install software packages during the migration process. Therefore, make sure that the available space of the C drive on the instance is at least 20 GiB, and the available space is larger than the size of the C:\Windows directory.

Linux

Item

Description

General limit

  • Anolis OS and Alibaba Cloud Linux do not provide i686-based software packages. If your CentOS operating system is equipped with i386-based 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.

  • The migration tool consumes resources to download and install software packages during migration. Before you migrate an operating system of an ECS instance, make sure that the following resources are available:

    • Memory size: 600 MiB

    • Available disk capacity for the following directories:

      • /usr: 250 MiB

      • /var: 4 GiB

      • /boot: 100 MiB

    Note

    If your instance has a small number of vCPUs, little memory, and a small storage capacity for the system disk and data disks, we recommend that you stop the services that are running on the instance before you perform migration. This helps prevent migration failures caused by insufficient resources.

Limit on migrating from CentOS 7 to Alibaba Cloud Linux 2

Alibaba Cloud Linux 2 uses kernel version 4.19, which is incompatible with kernel version 3.10 of 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 the applications in advance and determine whether they can run as expected after a direct migration.

Limit on migrating from CentOS 7 to Alibaba Cloud Linux 3

Alibaba Cloud Linux 3 uses Linux Kernel 5.10 LTS, which is incompatible with kernel version 3.10 of CentOS 7. In addition, the GNU toolchain of Alibaba Cloud Linux 3 contains GCC 10.2, Binutils 2.35, and glibc 2.32. 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 the applications in advance and determine whether they can run as expected after a direct migration.

Limit on migrating from CentOS 8 to Alibaba Cloud Linux 3

Alibaba Cloud Linux 3 uses Linux Kernel 5.10 LTS, which is compatible with the CentOS 8 ecosystem. In addition, the GNU toolchain of Alibaba Cloud Linux 3 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 performs a basic assessment on the operating system that you want to migrate.

The following table describes the limits on migrating features or software related to your operating system.

Feature or software

Supported

Migration affected

Description

i386-based software package

Not supported.

Yes

Alibaba Cloud Linux does not provide i386-based software packages. If your CentOS 7 or 8 operating system is equipped with i386-based software packages, you cannot use the migration tool to migrate the operating system. To prevent system exceptions, you must delete the i386-based software packages before you migrate operating systems

epel-modular

Not supported.

No

The Extra Packages for Enterprise Linux (EPEL) repositories of CentOS 7 or 8 and Alibaba Cloud Linux 3 depend on different platforms. You can migrate from CentOS 7 or 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 is equipped 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 an operating system, we recommend that you compile and verify your C/C++ programs by using the new GNU toolchain to prevent incompatibility issues.

Kernel module compatibility

Not supported.

No

Alibaba Cloud Linux 3 uses Linux Kernel 5.10 LTS, which is compatible with the CentOS 8 ecosystem but is not fully compatible with kernel version 3.10 of CentOS 7 and kernel version 4.18 of 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 the applications in advance 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.

  • If the destination MySQL version is the same as or later than the source MySQL version, the migration performance is not affected.

  • If the destination MySQL version is earlier than the source MySQL version, the migration performance is affected.

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 the MySQL version provided by CentOS 7 or 8, you cannot use the migration tool to migrate operating systems.

Operating system hot migration

Not supported.

No

During the migration process, software packages are re-installed. This causes services to restart and results in service interruptions. Before you proceed with the migration, you must create a snapshot for your disk to back up data and isolate the source operating system environment to prevent service interruptions. For more information, see Create a snapshot for a disk.

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 new disk is created for the system disk. Automatic snapshots that are released 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. Therefore, 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 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, we recommend that you delete the snapshots that you no longer need 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 image.png > 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.