All Products
Search
Document Center

Elastic Compute Service:FAQ about replacing the operating system of an instance

Last Updated:Aug 19, 2024

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 for 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?

You can replace the operating system with an image that contains data disk snapshots, replacing only the system disk of the original instance without affecting the data disks of the original instance.

Important

If the image that you use to replace the operating system of an ECS instance contains data disks, make sure that no business dependency exists between the original system disk and the data disks attached to the instance, or make sure that no issues occur when the new system disk performs operations on the data disks. For example, if the original system disk read data from and wrote data to the data disks, exceptions may occur when the new system disk reads data from and writes data to the data disks.

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

The following table describes the differences.

Item

After the system disk of an instance is re-initialized

After the system disk (operating system) of an instance is replaced

Features

The 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 disks

The 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.

  • 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 disabled 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, and you can configure an automatic snapshot policy for the new system disk based on your business requirements.

Charges

You 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 system disk when you replace the operating system of an ECS 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.