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.
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 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.
Revert to a Snapshot
Reverting a VM to the selected snapshot clears the current data and restores the VM data to the state captured when the selected snapshot was created.
Procedure
- In the navigation pane, choose .
- Select the target VM and click Snapshot.
- On the Snapshot tab, select the snapshot point to restore and click Revert.
-
In the Revert Snapshot? dialog, configure the following options:
Option Description Recovery Method Supports full recovery and custom recovery. Reverting to a snapshot rolls back the current data. - Full Recovery: Restores the data and disk sequence of the VM system disk and data disks to the snapshot point. Disks detached after snapshot creation might be attached again, and disks attached after snapshot creation might be detached.
- Custom Recovery: Select disks for recovery. Only the data of the selected disks is restored, and the disk sequence is not restored.
Note: If a disk in the snapshot has been detached, recovery of that disk is not currently supported.
Power Status Choose whether to automatically power on the VM after snapshot revert. -
Review the configuration and click OK.
Note:
- During snapshot revert, the system automatically powers off the VM, clears the current data, and rolls back VM data to the selected snapshot point.
- 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.
- 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 VM has at least one successfully created snapshot point.
- Make sure that the platform has sufficient compute, storage, and network resources for the new VM.
- If the selected snapshot is a memory snapshot, creating a VM from the snapshot 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 point 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 snapshot point. 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 .
-
The Snapshot page displays snapshot information in a tree hierarchy and supports sorting by snapshot quantity or snapshot capacity.
- After you select a VM, the details area displays all snapshots of the VM, including snapshot name, capacity, creation time, and available actions.
- After you select a specific snapshot of a VM, the details area displays the available actions, basic information, and snapshot information of the snapshot.
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 the current snapshot also deletes snapshots on its child branches.
- Deleting a snapshot consumes I/O. Do not restart the management node service during deletion.
- Snapshot data is merged before the snapshot is deleted. This process requires a certain amount of data storage capacity. If data storage capacity is insufficient, snapshot deletion might 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.
