Scenarios
Changing an ECS OS will change the system disk attached to the ECS. After the change, the system disk ID of the ECS will be changed, and the original system disk will be deleted.
If the OS running on an ECS cannot meet service requirements, change the ECS OS.
The cloud platform supports changing between image types (public images, private images, and shared images) and between OSs. You can change your OS by changing your ECS image.
Constraints
- An OS change takes about 1 to 4 minutes to complete. During this process, the ECS status is Changing OS.
- Do not perform any operations on the ECS before the system injects the password or key, or the login will fail.
- The ECS for which you want to change the OS must be in any of the following states: Stopped, Reinstallation failed, or Failed to change the OS.
- The target ECS must have a system disk attached.
- The EVS disk quota must be greater than 0.
- The system disk type cannot be changed.
- The system disk can be encrypted.
- If an ECS OS is changed using a full-ECS image, the ECS system disk can be encrypted.
Notes
- After the OS is changed, the original OS is not retained, and the original system disk is deleted, including the data in all partitions of the system disk.
- Changing the OS clears the data in all partitions of the system disk, including the system partition. Back up data before changing the OS.
- Changing the OS does not affect data in data disks.
- After the OS is changed, your service runtime environment must be deployed on the new OS again.
- After the OS is changed, the ECS will be automatically started.
- After the OS is changed, the system disk type of the ECS cannot be changed.
- After the OS is changed, the IP and MAC addresses of the ECS remain unchanged.
- After the OS is changed, custom settings (such as DNS and hostname) of the original OS will be reset. They need to be configured again.
- An OS change takes about 1 to 4 minutes to complete. During this process, the ECS status is Changing OS.
- After the OS is changed, the password for logging in to the ECS is reset. To retrieve the password, perform the following operations:
- The system disk capacity of an ECS with OS changed may change because the system disk capacity specified by the image of the changed OS may be changed.
- You can choose to encrypt the system disk of an ECS during OS change.
- When you change the OS from Windows to Linux or vice versa, note the following:
- To change Windows to Linux, install a tool or driver (such as NTFS-3G) that enables read and write access to Windows NTFS partitions.
- To change Linux to Windows, install software, such as Ext2Read or Ext2Fsd, to identify ext3 or ext4.
If there are LVM partitions on the Linux ECS, these partitions may fail to be identified after the OS is changed to Windows. Therefore, a change from Linux to Windows is not recommended.
Procedure
- Log in to the management console.
- Click
in the upper left corner and select a region and project. - Under Computing, click Elastic Cloud Server.
- Locate the row containing the target ECS and choose More > Manage Image/Backup > Change OS in the Operation column.
Only stopped ECSs support OS change. If the ECS is not stopped, stop it before proceeding with the change.
- Select the target image.
For details, see Creating an ECS.
Figure 1 Changing an OS
- (Optional) Select the Encrypted option to encrypt the system disk during OS change.
To enable encryption, click Create Xrole to grant KMS access permissions to EVS. If you have the granting permission, grant KMS access permissions to EVS. If you do not have the granting permission, contact the user who has the Security Administrator permissions to grant KMS access permissions. For details, see Can All Users Use the Encryption Feature?
Encryption parameters are as follows:
- Encryption: indicates that the EVS disk has been encrypted.
- Create Xrole: assigns KMS access permissions to EVS to obtain KMS keys. After the permissions are assigned, follow-up operations do not require assigning permissions again.
- Xrole Name: set to EVSAccessKMS, which means that permissions have been assigned to EVS to obtain KMS keys for encrypting or decrypting EVS disks.
- KMS Key Name: specifies the name of the key used by the encrypted EVS disk. You can select an existing key, or click Create KMS Key and create a new one on the KMS console. The default value is evs/default.
- KMS Key ID: specifies the ID of the key used by the encrypted data disk.
- (Optional) Select a License Type (Use license from the system or Bring your own license (BYOL)) if the changed OS running on your ECS is billed. For more details, see License Types.
The following OSs are billed:
- SUSE Linux Enterprise Server
- Oracle Enterprise Linux
- Red Hat Enterprise Linux
- Set Login Mode.
You can set the login mode for the ECS whose OS is to be changed based on service requirements.
- Click OK.
- On the Change OS page, confirm the settings and click Submit.
After the application is submitted, the ECS status changes to Changing OS. When this status disappears, the OS change is complete.
During the OS change process, a temporary ECS is created. After the OS change is complete, this ECS will be automatically deleted.
Follow-up Procedure
- If the OSs before and after the OS change are both Linux, and automatic mounting upon system startup has been enabled for data disks, the data disk partition mounting information will be lost after the OS is changed. In such a case, you need to update the /etc/fstab configuration.
- Write the new partition information into /etc/fstab.
It is a good practice to back up the /etc/fstab file before writing data into it.
To enable automatic partition mounting upon system startup, see Initializing EVS Data Disks.
- Mount the partition so that you can use the data disk.
mount Disk partition Device name
- Check the mount result.
df -TH
- If the OS change fails, perform the operations described in Procedure again to retry the OS change.
- If the attempt still fails, contact customer service for manual recovery at the backend.