Restore a disk to a snapshot state to recover from accidental deletions, misconfigurations, or ransomware attacks.
Limitations
A snapshot can only roll back the disk it was created from. To restore data to a different disk, create a disk from a snapshot.
After replacing the operating system of an ECS instance, snapshots of the original system disk cannot roll back the new system disk. As a workaround, create a pay-as-you-go disk from the snapshot, attach it to the instance, copy the data, and release the temporary disk to avoid unnecessary charges. See Create a data disk from a snapshot, Attach a data disk, and Release a cloud disk.
Shared snapshots and snapshot copies cannot be used for disk rollback.
Prerequisites
Before you begin, verify the following:
A snapshot exists for the disk, is available for rollback, and no snapshot creation is in progress.
The disk has not been released.
If the disk is attached to an ECS instance, the instance is stopped.
If the disk is part of a dynamic extended volume or RAID array, all services and applications using the disk are stopped with no active I/O operations.
Procedure
Disk rollback is irreversible. All data changed between the snapshot creation time and the rollback time is permanently lost. Create a snapshot of the current disk state before proceeding. See Create a snapshot manually.
The following steps use the Snapshots page. You can also roll back from the Instance page.
Go to ECS console - Snapshots.
In the upper-left corner of the page, select a region and resource group.
On the Disk Snapshot tab, find the target snapshot. In the Actions column, click Roll Back Disk.
In the Roll Back Disk dialog, select the confirmation checkbox, and click OK.
What to expect after rollback
System configuration reversion
After rolling back a system disk, the following configurations revert to their snapshot-creation state:
Configuration | Impact |
Hostname | Reverts to the snapshot-time hostname |
SSH settings | Reverts to the snapshot-time SSH configuration |
Passwords | Reverts to the snapshot-time passwords |
Network settings | Reverts to the snapshot-time network configuration |
Software repository settings | Reverts to the snapshot-time repository configuration |
Clock source | Reverts to the snapshot-time clock source |
Reconfigure these settings based on your current requirements after the rollback.
Disk size after rollback
If the disk was resized after the snapshot was created, the rollback reverts it to the original size. To restore the expanded size, resize the disk again:
SSH key pair and login credentials
Rolling back the system disk does not affect the current SSH key pair, username, or password. Use your existing credentials to log in after the rollback.
FAQ
How do I restore a specific file or folder without rolling back the entire disk?
Disk rollback restores the entire disk. To restore specific files from a data disk, use a temporary disk:
Create a temporary pay-as-you-go disk from the snapshot. See Create a data disk from a snapshot.
Attach the disk to an ECS instance. See Attach a data disk.
Bring the disk Online.
Copy the target files or folders to the original disk.
Detach and release the temporary disk. See Detach a data disk and Release a cloud disk.