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
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
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
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
Delete a Snapshot
Procedure
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
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.
