Before you perform important operations, such as rolling back disks, modifying critical system files, and replacing operating systems, we recommend that you create snapshots for system disks or data disks to back up data. If unexpected issues or data loss occurs, you can use the snapshots to restore data and ensure business continuity. This topic describes how to create a snapshot for a disk.
Create a snapshot
You can create a snapshot on the Instances or Cloud Disks page.
If the disk is in the In use state, make sure that the ENS instance to which the disk is attached is in the Running or Stopped state.
When you create a snapshot, do not perform operations that change the status of the associated ENS instance, such as stopping or restarting the instance. Otherwise, snapshot creation fails.
Do not create snapshots during peak hours. When you create a snapshot, the I/O performance of the disk decreases and the data reads and writes slow down.
If operations are performed on the disk and incremental data is generated while a snapshot is being created, the incremental data is not included in the snapshot.
You cannot resize a disk for which a snapshot is being created. Wait until the snapshot is created before you resize the disk.
Create a snapshot on the Instances page
Log on to the ENS console.
In the left-side navigation pane, choose .
On the Instances page, find the instance that you want to manage, click the vertical ellipsis icon in the Actions column, and then click Create Snapshot in the Disks and Image section.
On the Create Snapshot dialog box, configure the parameters described in the following table.
Parameter
Description
Parameter
Description
Snapshot Name
The value must be 2 to 128 characters in length, and can contain letters, digits, colons (
:
), underscores (_
), and hyphens (-
). The value must start with a letter and cannot start withhttp://
orhttps://
.Select Disk
The disk for which you want to create a snapshot. You can select a system disk or a data disk.
You can select only one disk to create a snapshot at a time. If multiple disks are attached to an instance, you must create multiple snapshots.
You can filter the disks for which you want to create a snapshot by disk ID or disk name.
Click OK. After the snapshot is created, wait about 5 seconds, then you can view the created snapshot on the Snapshots page.
Create a snapshot on the Cloud Disks page
Log on to the ENS console.
In the left-side navigation pane, choose .
On the Cloud Disks page, find the disk that you want to create, click the vertical ellipsis icon in the Actions column, and click Create Snapshot.
On the Create Snapshot dialog box, configure the Snapshot Name parameter.
Click OK. After the snapshot is created, wait about 5 seconds, then you can view the created snapshot on the Snapshots page.
Roll back a disk by using a snapshot
If data loss occurs on a disk due to reasons such as accidental operations and ransom viruses, you can use a snapshot of the disk to roll back the disk. This way, the disk reverts to the state it was in when the snapshot was created.
You cannot use a snapshot of one disk to roll back another disk.
A snapshot of the disk exists and can be used to roll back the disk. No snapshot is being created for the disk.
If a disk is attached to an ENS instance, stop the ENS instance before you roll back the disk.
After you roll back a disk by using a snapshot, data that you added, removed, or modified from the point in time when the snapshot was created to the point in time when the disk is rolled back is lost. The lost data involves the host configuration file and configurations such as the hostname, SSH settings, passwords, network settings, system software repository settings, and clock source. The host configuration file and configurations are restored to the states they were in when the snapshot was created. You must reconfigure the lost data based on your business requirements.
If you resized a data disk after you created a snapshot for the disk and use the snapshot to roll back the disk, the disk reverts to its original size when the snapshot was created. The additional disk space is lost. To restore the disk to the new size, you must log on to the ENS instance to which the disk is attached and resize the disk again.
Log on to the ENS console.
In the left-side navigation pane, choose .
On the Snapshots page, find the snapshot that you want to manage and click Roll Back Disk in the Actions column.
In the message that appears, click OK.
Create a disk from a snapshot
You can create a disk from a snapshot. The data on the new disk is the same as the data on the source disk when the snapshot was created. This facilitates environment cloning or data backup. For more information, see Create and manage a disk.
Create a custom image from a snapshot
To quickly replicate the environment of an ENS instance, you can create a custom image from a system disk snapshot of the instance. The custom image contains the operating system of the ENS instance, the software installed on the ENS instance, and the configurations and data stored on the ENS instance. You can create ENS instances that have identical environment settings as the original ENS instance from the custom image.
Custom images do not belong to any edge node and can be used in all edge nodes.ENS
Only system disk snapshots can be used to create custom images, and data disk snapshots cannot.
If the ENS instance from which a snapshot was created expires or is released, the custom images created from the snapshot and the ENS instance created from the images are not affected.
The amount of time required to create an image varies based on the sizes of disks.
Log on to the ENS console.
In the left-side navigation pane, choose
.On the Snapshots page, find the snapshot that you want to manage and click Create Custom Image in the Actions column.
On the Create Custom Image page, configure the Image Name parameter.
Click OK. After the custom image is created, you can view it on the Images page.
Delete a snapshot
If one or more snapshots are no longer needed or if the maximum number of snapshots is reached, you can delete snapshots to free up storage space and prevent unnecessary snapshot costs.
When you delete a snapshot, data that is contained in the snapshot is deleted, but the disk from which the snapshot was created is not affected.
When you delete a snapshot, all data that is contained in the snapshot is deleted and cannot be recovered. Deleted snapshots cannot be recovered. Proceed with caution.
If a disk is created from a snapshot, you need to delete the disk before you can delete the snapshot.
Log on to the ENS console.
In the left-side navigation pane, choose Snapshots.
On the Snapshots page, find the snapshot that you want to delete and click Delete Snapshot in the Actions column.
In the message that appears, click OK.
Replicate a snapshot across nodes
You can replicate snapshots across nodes to flexibly and reliably back up data. The ID of a snapshot replica is different from the ID of its source snapshot. The snapshot replica cannot be used to restore disks created from the source snapshot.
You can replicate snapshots across nodes only by calling an API operation or using the SDK. For more information about the API operation, see CopySnapshot.
Cross-node snapshot replication is applicable to the following scenarios:
DevOps:
You can replicate snapshots across nodes to start business in new nodes or migrate business systems to new nodes. This helps you reduce O&M costs and improve data availability.
Back up data across nodes:
Snapshot replication helps meet the requirements for compliance audit and improvement of business reliability. In the event of a disaster, you can restore your business systems by using snapshot replicas in another node. This reduces the recovery time objective (RTO) and recovery point objective (RPO).