This topic describes how to re-initialize a system disk in the Elastic Compute Service (ECS) console. After a system disk is re-initialized, it is restored to the state when it was created.

Prerequisites

  • Snapshots are created for the disk. For more information, see Create a snapshot for a disk.
  • The instance to which the disk is attached is in the Stopped state. For more information, see Stop an instance.
    Notice 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 re-initialize the disk.
    normal-stop
  • The instant access feature is disabled for the disk that is an enhanced SSD (ESSD). For more information, see Enable or disable the instant access feature.
  • An SSH key pair is created or imported for authentication if you re-initialize the system disk of a Linux instance. For more information, see Create an SSH key pair and Import an SSH key pair.

Background information

When a system disk is attached to an ECS instance, you can re-initialize the system disk to restore it to the state when it was created. The following section describes the changes of a system disk after the disk is re-initialized:

  • The system disk is restored to the state when it was created.
    Warning When a disk is re-initialized, all data stored in the disk is deleted. We recommend that you create snapshots for the disk to back up data before you re-initialize the disk.

    For example, if you use a Windows Server 2012 R2 public image to create an instance, the instance still runs Windows Server 2012 R2 after you re-initialize the system disk of the instance. However, the applications that were installed and data that was generated after the instance was created are deleted.

    Note If the system disk of an instance is replaced with a new system disk, the new system disk instead of the previous system disk can be re-initialized.
  • The automatic snapshot policy applied to the system disk before the re-initialization remains valid.
  • The IP addresses and disk IDs of the instance remain unchanged.
  • The automatic and manual snapshots of the system disk remain available. You can use these snapshots to roll back the disk. For more information, see Roll back a disk by using a snapshot.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. Find the ECS instance whose system disk you want to re-initialize and click the instance ID to go to the Instance Details page.
  5. Click the Cloud Disk tab.
  6. Find the system disk and click Reinitialize Disk in the Actions column.
  7. In the Reinitialize Disk dialog box, configure the parameters described in the following table.
    Parameter Description
    Security Windows instances: Select Set Password. You can use the old password or specify a new password.
    Linux instances: Select Set SSH Key or Set Password.
    • Set SSH Key: Bind an SSH key pair to the instance. You can log on to the instance by using the specified SSH key pair.
    • Set Password: Specify a logon password. You can use the old password or specify a new password.
    Security Hardening If you select Activate, security components are loaded to the instance free of charge. These components provide security features such as webshell detection, alerts of unusual logons, and protection against brute-force attacks.
    Instance Startup Policy If you select Start Instance after Resetting Disk, the instance automatically starts after you re-initialize the system disk.
  8. Click Confirm.

What to do next

  • If data disks have been attached to a Linux instance before you re-initialize its system disk, you must re-create the mount points for the data disk partitions and mount file systems to the data disk partitions. For more information, see the "How do I re-attach data disks after I re-initialize the system disk of a Linux instance?" section in How do I re-attach data disks after I re-initialize the system disk of a Linux instance?.
    Note After you re-initialize the system disk of a Linux instance, data stored in the data disks attached to the instance remains unchanged, but the mount information of the data disks is lost. You must re-create the mount points for the data disk partitions and mount file systems to the data disk partitions.
  • After the system disk is re-initialized, you must redeploy applications and configurations to restore your business.
  • If you have created snapshots for the system disk before the system disk is re-initialized, you can use the snapshots to create data disks and attach the data disks to the instance to obtain data originally stored in the system disk. For more information, see Create a disk from a snapshot.