Snapshot Management¶
This guide explains how to create snapshots for virtual machines and restore them.
You can create snapshots for virtual machines to save the current state of the virtual machine. A snapshot can be restored multiple times, and each time the virtual machine will be reverted to the state when the snapshot was created. Snapshots are commonly used for backup, recovery, rollback, etc.
Prerequisites¶
Before using the snapshots, the following prerequisites need to be met:
- Only virtual machines in a non-error state can use the snapshot function.
- Install CSI Snapshotter, first ensure that the CSI Snapshotter component is deployed. The snapshot-controller will monitor VolumeSnapshot and VolumeSnapshotContent objects and trigger related operations.
- Install Snapshot CRDs, Snapshot Controller, CSI Driver. Refer to CSI Snapshotter for more information.
- Wait for the csi-snapshotter and snapshot-controller components to be ready.
Create a Snapshot¶
-
Click Container Management in the left navigation menu, then click Virtual Machines to access the list page. Click the ︙ on the right side of the list for a virtual machine to perform snapshot operations (only available for non-error state virtual machines).
-
A dialog box will pop up, prompting you to input a name and description for the snapshot. Please note that the creation process may take a few minutes, during which you won't be able to perform any operations on the virtual machine.
-
After successfully creating the snapshot, you can view its details within the virtual machine's information section. Here, you have the option to edit the description, recover from the snapshot, delete it, among other operations.
Restore from a Snapshot¶
-
Click Restore from Snapshot and provide a name for the virtual machine recovery record. The recovery operation may take some time to complete, depending on the size of the snapshot and other factors. After a successful recovery, the virtual machine will be restored to the state when the snapshot was created.
-
After some time, you can scroll down to the snapshot information to view all the recovery records for the current snapshot. It also provides a way to locate the position of the recovery.