A virtual machine snapshot saves the current state of the virtual machine, and can be used to restore the virtual machine to that state in the event of an unexpected failure.
The Volume Snapshot has been deployed by the administrator in the platform management.
Virtual machine snapshots are based on volume snapshots. Ensure that at least one disk is bound to a storage class that supports volume snapshots, such as CephFS built-in storage.
Only offline snapshots of the virtual machine are supported. Please first stop the virtual machine before creating or rolling back to a snapshot.
If there are multiple storage types of the same kind in the cluster, for example, attaching multiple different sources of Ceph RBD storage, the disk snapshot functionality may not work properly when the virtual machine is using such storage.
The contents included in a virtual machine snapshot: virtual machine settings and the state of the disks that support volume snapshots.
Access Container Platform.
In the left navigation bar, click Virtualization > Virtual Machines.
Locate the virtual machine and click ⋮ > Create Snapshot.
Fill in the snapshot description. The description can help you document the current state of the virtual machine, such as Initial Installation
, Before Application Upgrade
.
Click Create. The time taken for the snapshot depends on network conditions and workload, please be patient.
Check the snapshot status.
When the snapshot changes to Ready
, it indicates that the creation was successful.
If the snapshot remains in Not Ready
status for a long time, click > View the reasons and troubleshoot, then recreate the snapshot.
Roll back the virtual machine settings and the disks that support volume snapshots to the state at the time the snapshot was created. For example, disks added after the snapshot creation will be removed; modified disk data will be restored.
If there are disks bound to a storage class that supports the LVM mechanism (for example, TopoLVM), please confirm with the administrator that the reclamation policy for that storage class is set to Retain (reclaimPolicy: Retain
) to use the snapshot rollback feature correctly.
Access Container Platform.
In the left navigation bar, click Virtualization > Virtual Machines.
Click on Virtual Machine Name.
In the Snapshots tab, locate the snapshot and click ⋮ > Rollback.
Read the prompt information on the interface, and click Rollback after confirming everything is correct.
Note: The rollback operation cannot be aborted or undone, please proceed with caution.
Click on the snapshot name to check in the “Snapshot Rollback Records” if the rollback has been completed. The time required for the rollback depends on network conditions and workload, please be patient.
Description
If the rollback fails, the virtual machine state remains unchanged. You can start the virtual machine normally or attempt to roll back the snapshot again.
If the virtual machine is started during the rollback process, it will revert to the state before it was stopped, and upon stopping the virtual machine again, it will continue rolling back to the state at the time of snapshot creation.
To avoid operational conflicts, please ensure that the most recent rollback record has been completed before performing other operations on that virtual machine.
Delete unnecessary virtual machine snapshots to free up disk resources.
When deleting a rolled-back virtual machine snapshot, if the virtual machine disk needs to copy data based on the snapshot (for example, TopoLVM), you must wait until a virtual machine based on the rollback version has been started before deleting, otherwise the virtual machine will fail to start.
Access Container Platform.
In the left navigation bar, click Virtualization > Virtual Machines.
Click on Virtual Machine Name.
In the Snapshots tab, locate the target snapshot and click ⋮ > Delete.
Read the prompt information and click Delete after confirming everything is correct.