When you use an Elastic Compute Service (ECS) instance, you can replace the operating system based on your needs. This topic describes how to use a public image or a non-public image (such as a custom image or shared image) to replace the operating system of an instance.
Prerequisites
- The operating system replacement operation replaces the system disk. After the operating system is replaced, the original system disk is released and all data stored on the disk is cleared. Before you replace the operating system of an instance, we recommend that you create a snapshot of the system disk to back up data. For more information, see Create a snapshot of a disk.
- The instance whose operating system you want to replace is in the Stopped state. If the instance is not in the Stopped state, stop it. For more information,
see Stop an instance.
Warning If the billing method of an instance is pay-as-you-go and the network type of the instance is VPC, you must enable the standard mode for the instance when you stop the instance. If you enable the economical mode for the instance, you may not be able to start the instance after you replace its operating system.
Background information
This topic describes how to use a public or non-public image to replace the operating system of a single instance in the ECS console. To batch replace the operating systems of multiple instances, you can use the ACS-ECS-BulkyReplaceSystemDisk public template provided by Operation Orchestration Service (OOS). For more information, see Public Templates.
For information about image types, see Image overview.
Precautions
Item | Description |
---|---|
Impacts on the system disk |
|
Impacts on the data disks | Data on the data disks attached to the instance is not affected. |
Impacts on snapshots |
|
Limits that apply when the replacement operating system is a Windows operating system |
|
Limits that apply when you replace a Windows operating system with a Linux operating system or replace a Linux operating system with a Windows operating system |
|
Charges |
You are not charged for the operating system replacement operation but are charged
for involved resources in the following situations:
|
Amount of time required to replace the operating system |
It takes about 10 minutes to replace an operating system. The actual amount of time
it takes varies based on the operating system.
Important After the operating system is replaced, you may be unable to log on to the instance
by using Virtual Network Computing (VNC) for some reasons such as slow boot. Wait
a while and log on to the instance again.
|
Procedure
What to do next
- Redeploy environments on the new operating system to run services.
- If both the replaced and replacement operating systems are Linux operating systems and the data disk partitions of the instance are configured to automatically mount on instance startup, the mounting information of the data disk partitions is lost. You must rewrite the mounting information of the data disk partitions to the /etc/fstab file. For more information, see Configure UUIDs in the fstab file to automatically attach data disks.
- (Optional) The automatic snapshot policy applied to the original system disk becomes invalid, and you can apply an automatic snapshot policy to the new system disk based on your needs. For more information, see Enable or disable an automatic snapshot policy.
- (Optional) Delete the snapshots of the original system disk that are no longer needed. For more information, see Delete a snapshot.
FAQ
Question | Answer |
---|---|
How do I modify the hostname of an instance when I replace its Linux operating system with a Windows operating system? | For Windows operating systems, hostnames must not exceed 15 characters in length. Modify the hostname of the instance based on your needs. For more information, see Modify the properties of an instance or ModifyInstanceAttribute. |
Which operating systems support visualization? |
|
How do I use the data disks of an instance after I replace its Linux operating system with a Windows operating system? | By default, Windows operating systems cannot recognize ext3, ext4, or xfs file systems.
We recommend that you perform one of the following operations on your data disks:
|
How do I use the data disks of an instance after I replace its Windows operating system with a Linux operating system? | By default, Linux operating systems cannot recognize New Technology File System (NTFS)
file systems. We recommend that you perform one of the following operations on your
data disks:
|