This topic describes how to roll back a disk by using a snapshot. You can perform a disk rollback when your OS is unresponsive, when an incorrect operation was performed, or when rolling back an application version is required. After you roll back the system disk, the current key pair or password of the corresponding instance is attached automatically.

Warning Before you roll back a disk, create a snapshot of the disk to ensure that you can perform data recovery if needed. Disk rollback is irreversible. Exercise caution when performing this action.

Prerequisites

  • A snapshot of the disk to be rolled back is created, and no new snapshot is being created for the disk. For more information, see created a snapshot.
  • The disk has not been released.
  • The disk to be rolled back is attached to an ECS instance, and the corresponding instance is stopped. For more information, see Attach to an ECS instance and Stop an instance.
    Note
    • After you replace the system disk, old system disk snapshots cannot be used to roll back the new system disk.
    • Pay-As-You-Go VPC instances may not be restarted in No fees for stopped VPC instances mode after you roll back the disk. We recommend that you disable No fees for stopped VPC instances before you stop the instance.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, click Instances.
  3. Select the target region.
  4. Locate the instance whose disk you want to roll back, and then click Manage.

  5. In the left-side navigation pane, click Instance snapshots.
  6. Select the target snapshot, and then click Roll Back Disk in the Actions column.
    Note Only one disk can be rolled back at a time. When you roll back a disk, other disks attached to the instance are not affected. After the rollback, the entire disk (rather than a partition or a directory) recovers to its status at a specified point in time.
  7. In the displayed dialog box, click OK.
    Note If you select Start Instance After Disk Rollback, the instance is restarted after you roll back the disk.

Related APIs

ResetDisk

What to do next

If you create a snapshot of a disk and then you scale out the disk, you need to log on to the instance to expand the capacity of the file system after disk rollback. For more information, see: