Manage VMs with Snapshots
VM snapshots preserve the state of a VM at a specific point in time. They are suitable for keeping a temporary rollback point before system changes, application upgrades, or configuration adjustments. You can create snapshots manually or use snapshot policies to create snapshots on a schedule.
A snapshot is not a backup and does not replace a disaster recovery solution. In production environments, use snapshots carefully based on service load, storage capacity, and retention requirements.
A snapshot inherits the encryption state of its disks. Snapshot data created from an encrypted disk remains encrypted and does not require separate snapshot encryption settings.
Snapshot Types
- Manual snapshot: Manually create a snapshot for the entire VM at any time. For more information, see Create a Snapshot.
- Scheduled snapshot: Use a snapshot policy to automatically create snapshots at specified times. For more information, see Create a Snapshot Policy.
- Automatic snapshot: The system triggers a one-time automatic snapshot in specific scenarios, such as system reset and VM cloning. When an image is created, the system automatically creates a temporary snapshot and deletes it after image creation is complete.
Snapshot Status
A VM snapshot records the system disk, data disks, and other VM information. Its status is Complete when none of its contents are missing. Its status is Incomplete when some disk snapshots are missing but others remain.
For example, if you migrate only some disks and delete their snapshots during migration, snapshots of the disks that were not migrated remain. You can still view the original VM snapshot as long as it contains at least one available disk snapshot.
Scenarios
- Fast fault recovery: If an exception occurs in a production environment, you can use snapshot rollback to quickly restore the VM to a normal state. Snapshot rollback is intended for temporary recovery from unexpected faults.
- Data development: Create snapshots for production data to provide near-real production data for data mining, report query, development, and testing.
- Improved operation fault tolerance: Before major operations such as system upgrades or service data migration, create one or more snapshots. If an error occurs during the operation, you can restore the system data to a normal state from a snapshot.
Create a Snapshot
You can create one or more snapshots for a VM to retain its temporary state at a specific point in time, allowing quick rollback if a fault occurs.
Before you begin
- If the VM has shared disks attached, snapshots are not supported.
- Memory snapshots are not supported for VMs that use distributed storage.
- Memory snapshots are not supported for VMs in Compatible CPU mode.
- Before you create a memory snapshot, make sure that the VM is running and that attached peripheral devices are detached.
- Too many VM snapshots can affect VM performance, data security, and data storage capacity. For long-term data protection, use dedicated backup or protection features.
Procedure
- In the navigation pane, choose .
- Select the target VM and click .
-
In the Create VM Snapshot dialog, configure the following options:
Option Description Name Enter a name for the VM snapshot. Description Enter a brief description for the snapshot. Memory Snapshot A memory snapshot preserves the real-time state of the VM. -
Review the configuration and click OK.
Note: Snapshot data created from an encrypted disk remains encrypted. No additional encryption settings are required.
Note: To ensure memory consistency, the VM is paused briefly during memory snapshot creation.
Results
If snapshot creation fails, some disk snapshots that were successfully created might remain. The VM snapshot is displayed as Incomplete and can be viewed on the VM's Snapshot tab.
Revert to a Snapshot
You can restore the entire VM or selected disks to the state recorded in a snapshot. Recovery overwrites the current data on the affected disks.
Before you begin
- Full recovery is not supported for incomplete VM snapshots.
- Custom recovery is not supported for VM snapshots that contain memory snapshots. If such a VM snapshot is incomplete, recovery is not supported.
Procedure
- In the navigation pane, choose .
- Select the target VM and click Snapshot.
- On the Snapshot tab, select the snapshot to restore from and click Revert.
-
In the Restore Virtual Machine dialog, configure the following options:
Option Description Recovery Method Select a recovery method based on the snapshot status:
- Full Recovery: Restores the data and disk order of the VM system disk and data disks to the state recorded in the snapshot. Previously detached disks might be attached again, and existing disks might be detached.
- Custom Recovery: Select the disk snapshots to restore from. Only data on the selected disks is restored. Unselected disks are not affected, and the disk order remains unchanged.
Note: Disk snapshots associated with detached disks cannot be selected.
For an incomplete VM snapshot without a memory snapshot, Custom Recovery is selected by default, and Full Recovery is unavailable.
Power Status Displayed only when the VM snapshot does not contain a memory snapshot. Select Power on after recovery as needed. For Custom Recovery, the disk table lists only available disk snapshots. Select at least one to restore from. If a message indicates that a snapshot for a selected disk is no longer available for recovery, select an available disk snapshot instead.
-
Review the configuration and click OK.
Note:
- The system automatically powers off the VM before recovery. Full recovery rolls back VM data, while custom recovery overwrites only the current data on the selected disks.
- During full recovery, if the number of VM NICs or CD/DVD drives differs from the configuration recorded in the snapshot, NICs and CD/DVD drives removed after snapshot creation are attached again, and newly attached NICs and CD/DVD drives are removed.
- Custom recovery from an incomplete snapshot does not recreate missing disk snapshots. The VM snapshot remains Incomplete.
- When reverting to a memory snapshot, if the IP address or MAC address in the snapshot conflicts with an existing VM, resolve the conflict before the revert. If you force the revert, the platform handles conflicts as follows:
- IP address conflict: The MAC address in the snapshot continues to be used. You must manually adjust the IP address after the revert.
- MAC address conflict: The MAC address in the snapshot continues to be used, but the related NIC is disabled after the revert.
Create a VM from a Snapshot
Create a new VM directly from a snapshot. This method does not overwrite the existing VM data.
Before you begin
- Make sure that the selected VM snapshot has a status of Complete.
- Make sure that the platform has sufficient compute, storage, and network resources for the new VM.
- If the selected snapshot contains a memory snapshot, creating a VM from it is not supported.
- If the snapshot contains encrypted disks, make sure that the key provider and keys protecting the snapshot are available. To enable VM encryption or encrypt an unencrypted disk, make sure that the default key provider is available.
Procedure
- In the navigation pane, choose .
- Select the target VM and click Snapshot.
- On the Snapshot tab, select the snapshot to use for the new VM and click New Virtual Machine.
-
In the New Virtual Machine from Snapshot dialog, configure the following options:
Snapshot Information
Option Description Snapshot Displays the selected VM snapshot. Basic Information
Option Description Name VM name. Quantity The default value is 1 and cannot be changed. Location Host or cluster where the VM resides. OS VM operating system, including Linux and Windows. Power State Choose whether to automatically power on the VM after it is created. VM Encryption Follows the current VM encryption state of the source VM. If VM encryption is currently enabled for the source VM, this option remains enabled and cannot be changed. Otherwise, the option is disabled by default and can be enabled as needed. Hardware Information
Option Description CPU Supports adjusting the total number of CPU cores. Memory Supports adjusting the memory size. Disk Displays the disk configuration recorded in the snapshot. Except for disk encryption, the configuration cannot be changed. Disk encryption is handled as follows:
- An encrypted disk in the snapshot remains encrypted, and disk encryption cannot be disabled.
- An unencrypted disk in the snapshot remains unencrypted by default. You can enable disk encryption as needed.
- If you manually enable VM encryption, disk encryption is also enabled for unencrypted disks.
NIC Supports adjusting the port group, MAC address, IP address, DNS assignment mode, and security group. Click Add NIC to add a NIC to the VM. You can customize the network address and features of the new NIC.
- Review the configuration and click OK.
What to do next
Some VM configurations depend on VMTools. After the VM is created, install VMTools so that related configurations can take effect. For more information about VMTools, see Install and Use VMTools.
View Snapshots
The platform provides a centralized page for managing all snapshots. You can also view snapshots of a specific VM on the VM's Snapshot tab.
Procedure
- In the navigation pane, choose .
-
Select the target VM to view its snapshot list.
The Snapshot page displays snapshot information in a tree hierarchy and supports sorting by snapshot count or capacity. After you select a VM, the list on the right displays snapshot names, capacities, creation times, and available actions.
-
Select a snapshot and view its details on the Overview tab.
- Basic Info: Check Snapshot Status, which is Complete or Incomplete.
- Snapshot Info: View the remaining disk snapshots, their associated disks, capacities, and other information.
Even if the system disk snapshot is missing, you can still find the VM snapshot and view its remaining contents as long as at least one disk snapshot is available.
Delete a Snapshot
Procedure
- In the navigation pane, choose .
- Select the target VM and click Snapshot.
- On the Snapshot tab, select the snapshot to delete and click .
-
Confirm the selected snapshot information and risk notice, and then click OK.
Note:
- Deleting an incomplete VM snapshot also deletes all disk snapshots that remain in it.
- The effect on other snapshots depends on the storage type. Check the confirmation dialog for the impact on snapshots on child branches and confirm the deletion scope.
- Deleting a snapshot consumes I/O. Do not restart the management node service during deletion.
- If the confirmation dialog indicates that snapshot data must be merged before deletion, make sure that the available data storage capacity meets the requirement shown in the dialog. Insufficient capacity causes deletion to fail.
Create a Snapshot Policy
Associate a snapshot policy with a specified VM to create snapshots automatically on a schedule.
Before you begin
- A VM can be associated with only one snapshot policy. A VM that already has a snapshot policy cannot be associated with another snapshot policy.
- If a VM has shared disks or RDM disks attached, it cannot be associated with a snapshot policy.
- Make sure that the VM resides on ZCE distributed storage.
Procedure
- In the navigation pane, choose .
- On the Snapshot Policy page, click New Snapshot Policy.
-
In the New Snapshot Policy dialog, configure the following options:
Option Description Name Snapshot policy name. Description Enter a brief description for the snapshot policy. Scheduled Snapshot Cycle Set the snapshot creation frequency. Snapshots can be created weekly or monthly, and creation time can be configured down to the minute. Start Time Set the time when the snapshot policy starts to run. End Time Set the end time of the snapshot policy. The value can be Never or Custom. Retained Snapshots Set the maximum number of snapshots to retain. Snapshots that exceed the limit are automatically deleted. Associated VM After VMs are associated, the system automatically creates snapshots for the associated VMs at the specified time when the snapshot policy takes effect. - Review the configuration and click OK.
Enable or Disable a Snapshot Policy
Manage the snapshot policy state by enabling or disabling the policy. After a snapshot policy is disabled, scheduled automatic snapshots are paused until the policy is enabled again.
Procedure
- In the navigation pane, choose .
- On the Snapshot Policy page, select the target snapshot policy and click .
Modify a Snapshot Policy
You can modify a snapshot policy, including its scheduled snapshot cycle, start time, end time, retained snapshot count, and associated VMs.
Procedure
- In the navigation pane, choose .
- On the Snapshot Policy page, select the target snapshot policy and click .
- In the Modify Configuration dialog, modify the snapshot policy as needed.
- Review the updated configuration and click OK.
Delete a Snapshot Policy
Procedure
- In the navigation pane, choose .
- On the Snapshot Policy page, select the target snapshot policy and click .
Snapshot Best Practices
When you use snapshots in a production environment, follow these recommendations:
- In a production environment, keep the number of snapshots for a single disk within five whenever possible. Too many snapshots can affect VM or disk I/O performance, data security, and data storage capacity.
- In a production environment, avoid creating snapshots for high-I/O VMs to ensure data integrity. When high I/O operations are running inside a VM, some data in memory might not yet have been written to disk and therefore cannot be saved in the snapshot.
- Snapshot capacity usage:
- In local storage or centralized storage scenarios, a new incremental snapshot uses only a small amount of storage space, while a new full snapshot uses storage space equivalent to one full copy.
- In distributed storage scenarios, creating a snapshot does not consume additional storage space by itself. However, after a snapshot is created, write operations to the original disk might trigger Copy-On-Write, causing each snapshot to consume storage space equivalent to the original disk.
- Before snapshot rollback, create a snapshot for the disk to protect the current disk data state.
- Impact of creating snapshots on current services:
In most cases, creating a snapshot does not affect current services. However, creating a full snapshot generates additional network I/O on the storage network. In local storage or centralized storage scenarios, disk I/O bandwidth usage is more noticeable, while disk IOPS are generally not affected.
- Impact of deleting snapshots on current services:
In most cases, deleting a snapshot also deletes snapshots on its child branches and merges the data into the disk. This process generates additional disk I/O bandwidth, and service I/O might slow down slightly.
