Changing the OS

Scenarios

Changing an ECS OS will change the system disk attached to the ECS. After the changing, 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 public cloud supports changing between image types (public images, Marketplace images, private images, and shared images) and between OSs. You can change your OS to the one of a different image type.

Constraints

  • After the OS of a yearly/monthly ECS is changed, the system disk capacity may be insufficient because the image of the change OS may be different. In such a case, detach the system disk for capacity expansion and then change the OS.
  • After the OS of a yearly/monthly ECS is changed, the ECS does not support Marketplace images due to cost reasons.
  • The free OS of a yearly/monthly ECS can only be changed to another free OS.
  • The ECSs created using a Marketplace image or yearly/monthly ECSs do not support changing their OSs.
  • The EVS disk quota must be greater than 0.
  • H2 ECSs do not support OS change.
  • Switching between the ECSs in BIOS boot mode and in UEFI boot mode is not allowed.

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.
  • Back up data before changing the OS. For details, see Cloud Backup and Recovery User Guide.
  • Changing the OS does not affect data in data disks.
  • After the OS is changed, your service running environment must be deployed in 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, customized configurations, such as DNS and hostname of the original OS will be reset and require reconfiguration.
  • It takes about 10-20 minutes to change the OS. During this process, the ECS is in Changing OS state.
  • For a Windows ECS, if you set a new password during OS change, the locally stored RDP file will become invalid. In such a case, download the RDP file again for logging in to the ECS.

Billing Rules

  • Changing an OS is not billed. After the OS of a pay-per-use ECS is changed, the ECS will be billed based on the new configuration (system disk and specifications).
  • After the OS of a pay-per-use ECS is changed, its fees may be different because the system disk capacity specified by the image of the changed OS may increase. For details, see Product Pricing Details.

Notes on Cross-OS Changing

Cross-OS changing indicates that the OS is changed between Windows and Linux.

  • To change Windows to Linux, install an NTFS partition tool, such as NTFS-3G for data reading and writing on the Windows ECS.
  • To change Linux to Windows, install software, such as Ext2Read or Ext2Fsd to identify ext3 or ext4.

    You are not advised to change Linux to Window on the cloud platform. The reason is as follows: If there are LVM partitions on the Linux ECS, these partitions may fail after the OS is changed to Windows.

Prerequisites

  • The target ECS has a system disk attached.
  • Necessary data has been backed up. (Changing the OS clears the data in all partitions of the system disk, including the system partition.)
  • If the original ECS uses password authentication while the new ECS uses key pair authentication, ensure that a key pair is available.
  • If a private image is required for changing the ECS OS, create the desired private image by following the instructions provided in Image Management Service User Guide.
    • If an ECS image is required, make sure that a private image has been created using the ECS.
    • If a local image file is required, make sure that the image file has been imported to the cloud platform and registered as a private image.
    • If a private image from another region is required, make sure that the image has been copied.
    • If a private image from another user account is required, make sure that the image has been shared with you.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select the desired region and project.
  3. Under Computing, click Elastic Cloud Server.
  4. Locate the row containing the target ECS. Click More in the Operation column and select Manage Image/Disk > Change OS.

    Before changing the OS, stop the ECS or select Automatically stop the ECSs and change their OSs.

  5. Modify related ECS parameters, such as Image Type and Image, based on service requirements.

    For a yearly/monthly ECS, if the system disk capacity is less than the size of your image, you must detach the system disk, expand its capacity, and attach it to the original ECS before changing the OS.

    For instructions about how to expand the system disk capacity, see Disk Capacity Expansion.

    Figure 1 Change OS
  6. Configure the login mode.

    If the target ECS uses key pair authentication, you can replace the original key pair.

    When using a private image to change the OS, you can use the private image password.

  7. Click OK.
  8. On the Change OS page, confirm the specifications, select I have read and agree to the Huawei Image Disclaimer, and click Submit.

    After the application is submitted, the ECS status changes to Changing OS. The OS changing has been completed when Changing OS disappears.

    A temporary ECS is created during the OS changing process. After the process 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 partition mounting upon system startup has been enabled for the data disk, 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.
    1. Write the new partition information into /etc/fstab.

      You are advised to back up the /etc/fstab file before writing data into it.

      To enable automatic partition mounting upon system startup, see Initializing a Linux Data Disk (fdisk).

    2. Mount the partition so that you can use the data disk.

      mount Disk partition Device name

    3. Check the mount result.

      df -TH

  • If the OS change is unsuccessful, perform steps 3 to 8 again to retry changing the OS again.
  • If the second OS change attempt is unsuccessful, contact customer service for manual recovery at the backend.