Replacing an operating system is the process of replacing its system disk. This topic answers frequently asked questions (FAQs) and provides solutions for replacing the operating system (system disk) of an Elastic Compute Service (ECS) instance.
How do I replace an operating system (system disk)?
You can replace the operating system (system disk) by replacing the image of an ECS instance.
When you replace the operating system (system disk), the original system disk is released and all data on it is purged. Before you perform this operation, create a snapshot of the system disk to back up your data.
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 first share the custom image with Account B. Then, Account B can use the image to replace the operating system (system disk).
If an image contains data disks, can I use the image to replace an operating system?
You can use an image that contains data disks to replace an operating system. Only the system disk of the original instance is replaced. The data disks of the original instance are not affected.
If you use a custom image that contains data disks to change the operating system, make sure that no dependencies exist between the system disk and the data disks in your services. You must also make sure that operations on the data disks from the new system disk do not affect your business processes. For example, if your services involve read and write operations from the system disk to a data disk, changing the operating system may cause issues, such as abnormal read and write operations on the data disk, because the system disk is changed.
What are the differences between replacing an operating system and re-initializing a system disk?
The main differences are shown in the following table:
Item | Re-initialize the system disk | Change the system disk (operating system) |
Feature differences | Re-initialization restores an ECS instance to its initial state. The operating system version does not change. | You can switch the current operating system to a different type or version. |
Impact on the system disk |
|
|
Impact on data disks | Data disks are not affected. | Data disks are not affected. |
Impact on snapshots |
|
|
Billing | Re-initializing a system disk is free of charge. Because the operating system remains unchanged, the billable items do not change. | Changing the operating system is free of charge. However, fees are incurred in the following cases:
|
What do I do if I fail to resize a system disk by replacing the operating system?
When you replace the operating system to resize a system disk, the partition extension may fail due to a timeout. If the system disk is not successfully resize, you must manually extend the partitions. For more information, see Extend partitions and file systems (Linux). This method extends only the system disk partitions and does not affect the operating system 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. I/O optimized instances can use only I/O optimized images, and non-I/O optimized instances can use only non-I/O optimized images. Therefore, if the I/O optimization properties of the instance and image do not match, you cannot select the target image when you replace the operating system. 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
Change to a new instance type. All instance types that are available for purchase are I/O optimized.
You can select an image that supports I/O optimized instances to replace the operating system by replacing the system disk.
You can call the DescribeInstances operation and check the value of the IoOptimized parameter to check the I/O optimization property of the instance.
You can call the DescribeImages operation and check the value of the IsSupportIoOptimized parameter to check the I/O optimization property of the image.