Updated on 2026-05-18 GMT+08:00

Reinstalling the OS

Scenarios

If the OS of an ECS fails to start or requires optimization, reinstall the OS.

Notes

  • After the OS is reinstalled, the IP and MAC addresses of the ECS remain unchanged.
  • Reinstalling the OS clears the data in all partitions of the system disk, including the system partition. Back up data before reinstalling the OS. For details, see Backing Up an ECS.
  • Reinstalling the OS does not affect data in data disks.
  • Do not perform any operations on the ECS immediately after its OS is reinstalled. Wait for several minutes until the system successfully injects the password or key. Otherwise, the injection may fail, and the ECS cannot be accessed.

Constraints

  • The EVS disk quotas must be greater than 0.
  • If the target ECS is created using a private image, ensure that the private image is available.
  • H2 ECSs do not support OS reinstallation.

Prerequisites

  • The target ECS has a system disk attached.

Procedure

  1. Log in to the ECS console and access the ECS list page.
  2. Locate the row containing the target ECS and choose More > Manage Image > Reinstall OS in the Operation column.

    Before reinstalling the OS, stop the ECS first or select Stop the ECS in the Reinstall OS dialog box.

  3. (Optional) Select the Encrypted option to encrypt the system disk during OS reinstallation.

    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.

    Encryption parameters are as follows:

    • Agency Name: specifies the name of the agency that is used to grant EVS the permissions needed to obtain KMS keys for disk encryption and decryption. When Agency Name is displayed as EVSAccessKMS, KMS permissions have been granted to EVS.

      To use the encryption feature, click Create Agency first to grant EVS the permissions needed to obtain KMS keys for EVS disk encryption and decryption.

      If you do not have sufficient permissions to grant EVS, apply for required permissions from the user who has the Security Administrator permissions.

      For details, see Can All Users Use the Encryption Feature?

    • KMS Encryption: specifies how to obtain a KMS key.
      • Select an existing key: Select a KMS key from the KMS Key Name drop-down list.
      • Enter a key ID: Select a KMS key using the key ID.
    • (Optional) KMS Key Name: specifies the name of the key used to encrypt EVS disks. This parameter is displayed only when KMS Encryption is set to Select an existing key.

      You can select an existing key pair, or click Create KMS Key and create a KMS key on the KMS console. The default value is evs/default.

    • KMS Key ID: specifies the ID of the key used to encrypt data disks.
  4. Set Login Mode.

    You can set the login mode for the ECS whose OS is to be reinstalled based on service requirements.

    • Password

      If you select Password for Login Mode, set a new password based on the password complexity requirements and confirm the new password.

      Table 1 Password complexity requirements

      Parameter

      Requirement

      Password

      • Consists of 8 to 26 characters.
      • Contains at least three of the following character types:
        • Uppercase letters
        • Lowercase letters
        • Digits
        • Special characters for Linux: !@%-_=+[]:./^,{}?
      • Cannot contain the username or the username spelled backwards.
    • Key pair

      If you select Key pair for Login Mode, select an existing key pair from the drop-down list or create a key pair. For details, see (Recommended) Creating a Key Pair on the Management Console.

      If you use an existing key pair, make sure that you have saved the key file locally. Otherwise, logging in to the ECS will fail.

  5. Click OK.
  6. On the Reinstall OS page, confirm the settings, read and agree to the agreement or disclaimer, and click OK.
    After the request is submitted, the status Reinstalling is displayed. When this status disappears, the reinstallation is complete.

    During the reinstallation process, a temporary ECS is created. After the reinstallation is complete, this ECS will be automatically deleted. Do not perform any operation on the temporary ECS during the reinstallation process.

Follow-up Procedure

If the system displays a message indicating that the reinstallation fails, you can perform steps in Procedure again to retry the OS installation.

If the attempt still fails, contact customer service for manual recovery at the backend.