If you have created snapshots from a disk, you can roll the disk back to its state at a specific point in time. The operations described in this topic apply to system disks and data disks.

Prerequisites

Before you roll back a disk, make sure that the following requirements are met:
  • One or more snapshots are created for the disk. No snapshot is being created for the disk.
  • The disk is not released.
  • Snapshots of the previous system disk cannot be used to roll back the new system disk after the system disk is replaced.
  • The disk is attached to an ECS instance and the instance is in the Stopped (Stopped) state.
    Notice If the No Fees for Stopped Instances (VPC-Connected) feature is enabled, set Stop Mode to Retain Instance and Continue Charging After Instance is Stopped when you stop a VPC-type pay-as-you-go instance. Otherwise, the instance may fail to be started after the disk is rolled back. For more information, see No Fees for Stopped Instances (VPC-Connected).

Background information

Before you roll back a disk, take note of the following items:
  • Rollback operations cannot be reversed. After a rollback is complete, the data before the rollback cannot be restored. Exercise caution when you perform this operation.
  • After a disk is rolled back, the data from the time when the snapshot was created to the time when the rollback is performed is lost.
  • After a system disk is rolled back, the SSH key pair or password used by the instance is automatically bound to the new system disk.

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 an ECS instance in the Stopped state and click the instance ID to go to the Instance Details page.
  5. In the left-side navigation pane, click Snapshots.
  6. Find the target snapshot and click Rollback Disk in the Actions column.
  7. In the message that appears, click OK.

What to do next

  • If you resize a disk after you create a snapshot of the disk, the size of the disk is also rolled back after you roll back the disk. To make the disk revert to the size before the rollback, you must log on to the instance to resize the file system again. For more information, see the following topics:
  • If you want to retain important or partial data generated from the time when the snapshot was created to the time when the rollback is performed, you can create a data disk from the latest snapshot generated during that period, attach the new data disk to the ECS instance, and then synchronize the data within the ECS instance. Synchronize data