All Products
Search
Document Center

:FAQ about replacing an operating system

Last Updated:Apr 27, 2026

Common questions about replacing an ECS instance system disk, including snapshots and billing.

How do I replace an operating system (system disk)?

Replace the operating system (system disk) by replacing the image of the ECS instance.

Warning

Replacing the operating system releases the original system disk and purges all its data. Create a snapshot of the system disk before you proceed.

Can a custom image created from an instance in Account A be used to replace the operating system of an instance in Account B?

Yes. Account A must share the custom image with Account B, which can then use it to replace the operating system (system disk).

If an image contains data disks, can I use the image to replace an operating system?

Yes. Only the system disk is replaced. Data disks are not affected.

Important

If you use a custom image that contains a data disk to change the operating system, make sure that there are no service dependencies between the system disk and data disks, or that the new system disk's interaction with the data disks does not disrupt your business processes. For example, if your services read data from or write data to the data disks, changing the operating system can cause data access errors after the system disk is replaced.

What are the differences between replacing an operating system and re-initializing a system disk?

The main differences are described in the following table.

Item

Re-initialize system disk

Change operating system

Functional differences

Re-initialization restores the ECS instance to its initial state. The operating system remains the same.

Switches the instance to a different operating system.

Impact on the system disk

  • The old system disk is not released.

  • The data on the system disk is restored to its initial state. Applications installed and data generated after the instance was created are cleared. We recommend that you back up your data.

  • The system disk ID, disk type, and the IP address of the ECS instance remain unchanged.

  • When you change the operating system, the original system disk is released.

  • All data on the system disk is cleared. We recommend that you back up your data.

  • The system disk ID changes, but the disk type, the IP address of the ECS instance, and the MAC address of the elastic network interface remain unchanged.

Impact on data disks

Data disks are not affected.

Data disks are not affected.

Impact on snapshots

  • Snapshots created from the system disk can be used to roll back the disk.

  • Both manual snapshots and automatic snapshots created from the system disk are retained.

  • The automatic snapshot policy remains effective and does not need to be reset.

  • You cannot use snapshots of the original system disk to roll back the new system disk, but they can be used to create custom images.

  • Manual snapshots created from the original disk are not released.

  • For automatic snapshots, if the Delete Automatic Snapshots While Releasing Disk option is enabled for the old system disk, the snapshots are automatically deleted. If the Delete Automatic Snapshots While Releasing Disk option is not enabled, they are automatically released after they expire.

  • The automatic snapshot policy for the original system disk becomes invalid, and you must reset it.

Billing

Re-initializing a system disk is free of charge. Billing is not affected because the operating system remains the same.

Changing the operating system is free of charge. However, fees are charged in the following cases:

  • If the new image is a paid image, you are charged for the image. For more information, see Image billing.

  • If you increase the capacity of the system disk when you change the operating system, you are charged for the additional capacity. For more information, see Block storage billing.

What do I do if I fail to resize a system disk by replacing the operating system?

Partition extension may fail due to a timeout during the OS replacement. If the system disk is not resized successfully, manually extend the partitions and file systems. This only extends the system disk partitions and does not affect the OS version.

When I replace an operating system, what do I do if the target image is not available and a message indicates that the instance is non-I/O optimized?

Cause

The I/O optimization property of the instance must match that of the image. If they do not match, you cannot select the target image, and the following message appears: 'This instance is non-I/O optimized. You can select only non-I/O optimized images to replace the operating system.'

Solutions

  1. Change to a new instance type. All purchasable instance types are I/O optimized.

  2. Select an I/O optimized image and replace the operating system by replacing the system disk.

Note
  • Call DescribeInstances and check the IoOptimized parameter to determine the I/O optimization property of the instance.

  • Call DescribeImages and check the IsSupportIoOptimized parameter to determine the I/O optimization property of the image.