An operating system replacement operation replaces a system disk. This topic provides answers to frequently asked questions (FAQ) about replacing the operating system (system disk) of an Elastic Compute Service (ECS) instance.

How do I replace the operating system (system disk) of an instance?

You can replace the operating system of an instance by replacing the image. For more information, see Replace the operating system (system disk) of an instance.

Warning After the operating system (system disk) of an instance is replaced, the original system disk is released and all data stored on the disk is deleted. Before you replace the operating system, we recommend that you create a snapshot of the original system disk to back up data. For more information, see Create a snapshot of a disk.

Can I use an image created from an instance in Account A to replace the operating system of an instance in Account B?

Yes, you can share the image from Account A to Account B and then use the image to replace the operating system of an instance in Account B. For more information, see Share a custom image and Replace the operating system (system disk) of an instance.

When I replace the operating system of an instance, can I select an image that contains data disk snapshots?

No, you cannot select an image that contains data disk snapshots when you replace the operating system of an instance.

If you want to use such an image to replace the operating system of an instance, we recommend that you perform the following operations:
  1. Use the image to create a pay-as-you-go instance. For more information, see Use a custom image to create one or more instances.
  2. Create a snapshot for the system disk of the new instance. For more information, see Create a snapshot of a disk.
  3. Create a custom image from the system disk snapshot. This custom image contains only a system disk snapshot. For more information, see Create a custom image from a snapshot.
  4. Use the created custom image to replace the operating system of an instance. For more information, see Replace the operating system (system disk) of an instance.

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

The following table describes the differences.
ItemAfter the system disk of an instance is re-initializedAfter the system disk (operating system) of an instance is replaced
FeaturesThe instance is restored to the initial state when it was created. The operating system of the instance remains unchanged before and after initialization. The operating system of the instance is changed.
Impacts on the system disk
  • The original system disk of the instance is not released.
  • The system disk of the instance is restored to the initial state when it was created and the applications installed and data generated after the instance was created are deleted. We recommend that you back up data.
  • The ID of the system disk, the category of the system disk, and the IP addresses of the instance remain unchanged.
  • The original system disk is released.
  • All data stored on the original system disk is deleted. We recommend that you back up data.
  • The ID of the system disk is changed. The category of the system disk, the IP addresses of the instance, and the media access control (MAC) addresses of the elastic network interfaces (ENIs) that are attached to the instance remain unchanged.
Impacts on the data disksThe data disks are not affected. The data disks are not affected.
Impacts on snapshots
  • The snapshots created for the system disk can be used to roll back the system disk.
  • The manual and automatic snapshots created for the system disk are retained.
  • If an automatic snapshot policy is applied to the system disk, the policy remains in effect for the disk.
  • The snapshots of the original system disk cannot be used to roll back the new system disk, but can be used to create custom images.
  • The manual snapshots of the original system disk are not released.
  • If Delete Automatic Snapshots While Releasing Disk is enabled for the original system disk, the automatic snapshots of the disk are automatically released along with the disk. If Delete Automatic Snapshots While Releasing Disk is not enabled for the original system disk, the automatic snapshots of the disk are not automatically released until they expire.
  • The automatic snapshot policy applied to the original system disk becomes invalid. In this case, you must configure an automatic snapshot policy for the new system disk.
ChargesYou are not charged for initializing the system disk. The operating system of the instance remains unchanged before and after initialization so that billable items remain unchanged.
You are not charged for replacing the operating system of an instance but are charged for the resources that are used in the following scenarios:
  • If the replacement image is a paid image, you are charged for the image. For more information, see Images.
  • If you extend the capacity of the system disk when you replace the operating system of an instance, you are charged for the disk capacity increment. For more information, see Block storage devices.

What do I do if partitions on the system disk of an instance fail to be extended when I extend the disk by replacing the operating system of the instance?

If you extend the system disk of an instance by replacing the operating system of the instance, partitions on the system disk may fail to be extended due to a timeout error. You can perform the operations that are described in Extend the partitions and file systems of disks on a Linux instance to manually extend the partitions that fail to be extended. The partition extend operations only extend the system disk partitions and do not affect the version of the operating system.

What do I do if the desired image is not found and I am prompted that the instance is non-I/O optimized when I replace the operating system of an instance?

I/O optimized instances can use only I/O optimized images. Non-I/O optimized instances can use only non-I/O optimized images. This is why you cannot find the desired image and are prompted that the instance is non-I/O optimized. We recommend that you select an available image to replace the operating system.
Note You can call the DescribeInstances operation to query whether an instance is I/O optimized and call the DescribeImages operation to query whether an image is I/O optimized.