If you want to reset an Elastic Compute Service (ECS) instance or clear the data on a system disk, re-initialize the system disk to restore the initial status of the disk. This topic describes how to re-initialize a system disk.
Precautions
Take notes of the following items:
Upon re-initialization, the system disk reverts to its initial status as when first created, and any stored data is cleared.
NoteIf you re-initialize the system disk of an instance after the system disk is replaced, the new system disk instead of the original disk is re-initialized.
If an automatic snapshot policy is configured for a system disk, the policy still takes effect after the system disk is re-initialized. You do not need to reconfigure the policy.
Re-initializing the system disk of an instance does not change the IP address or system disk ID of the instance.
After you re-initialize a system disk, the snapshots that were created based on the system disk are retained.
Procedure
Step 1: Make preparations
Create a snapshot for the system disk that you want to re-initialize to back up data. For more information, see Create a disk snapshot.
WarningRe-initialization clears the data that was written to the system disk. Before re-initialization, we recommend that you create a snapshot for the system disk to back up data.
Stop the ECS instance to which the system disk is attached. For more information, see Stop an instance.
ImportantIf an ECS instance uses the pay-as-you-go billing method and resides in a VPC, you must enable the standard mode when you stop the instance. If you enable the economical mode, you may be unable to start the instance after you re-initialize the disks attached to the instance.
Make sure that the instant access feature is disabled for the system disk if the disk is an enhanced SSD (ESSD). A disk with the instant access feature enabled cannot be re-initialized. For more information, see Enable or disable instant access.
(Only applicable to Linux instances) Create or import an SSH key pair if you want to use the SSH key pair for authentication during system disk re-initialization. For more information, see Create an SSH key pair and Import an SSH key pair.
Step 2: Re-initialize a system disk
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Find the ECS instance whose system disk you want to re-initialize and click the instance ID to go to the Instance Details page.
Click the Block Storage tab, find the system disk that you want to re-initialize, and then click Re-initialize Disk in the Actions column.
Configure parameters in the Re-initialize Disk dialog box that appears.
Parameter
Description
Username
Specify a username that you want to use to log on to the instance.
Logon Credentials
For a Windows instance, select Password to reset the logon password for the instance. You can use the original password or specify a new password.
For a Linux instance, select Key Pair or Password.
Key Pair: Specify an SSH key pair to bind to the instance. Then, you can log on to the instance by using the specified SSH key pair.
Password: Reset the logon password. You can use the original password or specify a new password.
Security Hardening
By default, Enable for Free is selected. The security component is automatically loaded to your ECS instance free of charge. The security component provides security features such as webshell detection, remote logon reminders, and brute-force attack blocking.
Instance Startup Policy
By default, Start Instance After Re-initialing Disk is selected. After the system disk is re-initialized, the instance is automatically started. If this check box is not selected, manually start the instance as needed.
Click Confirm to re-initialize the system disk. The disk enters the Initializing state.
After the system disk is re-initialized, the disk enters the In Use state.
(Conditionally required) If the ECS instance to which the system disk is attached runs Linux and a data disk is attached to the ECS instance before the system disk is re-initialized, the mount information of the data disk is lost. You must create a mount point for the data disk and mount a file system to the data disk. For more information, see How do I re-attach data disks after I re-initialize the system disk of a Linux instance?
NoteRe-initializing the system disk does not change data stored on the data disk, but the mount information of the data disk is lost. In this case, this step is required.
After the system disk is re-initialized, redeploy your business (including applications and configurations) to resume services as soon as possible.