Manage VM snapshots

A snapshot is a replica of a VM as it was when you take the snapshot. If the image file of a VM is damaged or deleted, the snapshot data will be lost.

Snapshots can be used for VM recovery and VM creation when application software and VM OS incompatibility occur because of new application software installation, VM OS upgrade, or application software upgrade.

You can create a snapshot for one VM, or create a snapshot policy to take effect periodically on multiple VMs. To create a snapshot policy, see "Add a snapshot policy."

You can create either internal or external snapshots for a VM. If a VM has an internal snapshot, you cannot create external snapshots for it, and vice versa.

Internal snapshots

When you create a snapshot for a VM, the system sets the allocated clusters in the disk of the VM to read-only state to indicate that these clusters have been referenced by the snapshot. Before writing new data into a cluster, the system copies the data in the cluster to a new cluster, and subsequent edits will be executed in the new cluster. Internal snapshots are stored in the disk files of VMs. Therefore, if the disk file of a VM is corrupted or deleted, the snapshot data will be lost.

Deleting internal snapshots releases disk space. As a best practice to save disk space, do not create too many snapshots for a VM. When necessary, you can delete some snapshots to release disk space.

External snapshots

When you create a snapshot for a VM, the system sets the disk of the VM to read-only state and creates an incremental image file for the VM. Subsequent edits to the VM's disk will be executed in the incremental image file. When you create a snapshot for the VM again, the system sets both the original disk and the incremental image file of the VM to read-only state and creates a new incremental image file for the VM to form an image chain. External snapshots store only incremental data, so they do not affect the VM services and are applicable to VMs with frequent service changes.

Deleting external snapshots for a VM does not affect the VM or other snapshots of the VM. When you delete an external snapshot of a VM, the image files of the VM are merged. The data stored in the incremental image file created after the snapshot is taken will be written into the upper-level image file. As a best practice to avoid long image chains, do not create too many snapshots for a VM. When necessary, you can delete some snapshots to consolidate the image chain and improve VM performance.

After you create or restore external snapshots multiple times for a VM, redundant incremental image files might exist, for example, the incremental image file that is not merged into the upper-level image file after you delete the associated external snapshot. To prevent redundant incremental image files from affecting VM performance, you can consolidate the image chain of the VM to merge the images and increase the disk read speed. After you consolidate the image chain of the VM, incremental image files will be merged into their upper-level images on the premise that data dependency is not affected.

Figure-1 Image chain

 

Prerequisites

Restrictions and guidelines

Create a VM by using a snapshot

  1. On the top navigation bar, click VMs. If multiple clusters exist in the system, you must also select a cluster from the left navigation pane.

  1. Select a VM, click More on the VM tile, and then select Snapshot, or select a VM from the navigation pane to enter the VM overview page, and then click Snapshot.

  1. From the VM snapshot navigation pane, select the target snapshot, and then click Add VM.

  1. Configure the VM parameters as described in "Parameters."

  1. Click Finish.

Create a snapshot

  1. On the top navigation bar, click VMs. If multiple clusters exist in the system, you must also select a cluster from the left navigation pane.

  1. Select a VM, click More on the VM tile, and then select Snapshot, or select a VM from the navigation pane to enter the VM overview page, and then click Snapshot.

  1. Click Create, and then enter a name and description. For a VM in running or suspended state, you must set memory snapshot and timeout, as described in "Parameters."

  1. Click OK.

Edit a snapshot

  1. On the top navigation bar, click VMs. If multiple clusters exist in the system, you must also select a cluster from the left navigation pane.

  1. Select a VM, click More on the VM tile, and then select Snapshot, or select a VM from the navigation pane to enter the VM overview page, and then click Snapshot.

  1. Click Edit in the Actions column for a snapshot.

  1. Edit the snapshot name and description as needed, and then click OK.

Restore a VM from a snapshot

After you restore a VM by using a snapshot, data written after the snapshot is taken will be lost. Please be cautious. If the memory is not included in the snapshot, the VM will be in shutdown state after restoration.

To restore a VM from a snapshot:

  1. On the top navigation bar, click VMs. If multiple clusters exist in the system, you must also select a cluster from the left navigation pane.

  1. Select a VM, click More on the VM tile, and then select Snapshot, or select a VM from the navigation pane to enter the VM overview page, click More Actions, and then select Snapshot.

  1. Select a snapshot, and then click Restore.

  1. In the dialog box that opens, click OK.

Delete snapshots

Deleting a snapshot will not affect the VM operation, but you cannot restore the VM to the state when the snapshot was taken.

To delete snapshot:

  1. On the top navigation bar, click VMs. If multiple clusters exist in the system, you must also select a cluster from the left navigation pane.

  1. Select a VM, click More on the VM tile, and then select Snapshot, or select a VM from the navigation pane to enter the VM overview page, click More Actions, and then select Snapshot.

  1. Delete a snapshot:

Cancel an external snapshot deletion task

The system can cancel deletion of the external snapshots that are being deleted. The system cannot cancel deletion of the external snapshots that have been deleted. You can view the progress of an external snapshot deletion task in the task console.

To cancel an external snapshot deletion task:

  1. Select external snapshots from the snapshot history tree for a VM, click Delete, and then click OK.

  1. Access the task console, right click the external snapshot deletion task, and then click Cancel Task.

Consolidate the image chain of a VM

  1. From the left navigation pane, select Resources > host pool name > host name > VM name or Resources > host pool name > cluster name > host name > VM name. If multiple clusters exist in the system, you must also select a cluster from the left navigation pane.

  1. Click Snapshot.

  1. Click Consolidate Image Chain.

  1. In the dialog box that opens, click OK.

Parameters

Create a VM by using a snapshot:

Create a snapshot:

Delete a snapshot: