March 5, 2019
Top 10 Facts About Hyper-V Snapshots
Taking storage snapshots has proven to be an extremely effective feature for those working in virtual environments. However, snapshot technology might backfire if used without proper knowledge of how it works, what pros and cons it entails, and how snapshots can function in your IT infrastructure. This blog post describes how storage snapshots are used in Hyper-V virtual environments and presents you with a list of the top 10 things that you should know about Hyper-V snapshots.
What is a Hyper-V snapshot?
A Hyper-V snapshot (currently known as a Hyper-V checkpoint) represents a point-in-time copy of a selected virtual machine (VM), which allows you to capture the VM state, data, and its hardware configuration at a particular moment. Hyper-V snapshots are primarily used to revert a VM to its previous state in case any unnecessary changes were applied to the VM and the user wants to discard them. The main advantage of this technology is that Hyper-V snapshots can be easily and rapidly taken online and offline, without causing any workflow interruptions within a running VM. In Hyper-V, multiple snapshots can be created, deleted, and applied to a single VM.
Key things about Hyper-V snapshots
Below, we list the top 10 facts about Hyper-V snapshots that every Hyper-V user should be aware of to successfully utilize this technology in their virtual environments.
- Hyper-V snapshots are in fact called checkpoints
Some of you may wonder why we refer to the snapshot technology in Hyper-V as snapshots and not as checkpoints. It is true that along with the release of Windows Server 2012 R2, Hyper-V snapshots were renamed to Hyper-V checkpoints in Hyper-V Manager in order to match the terminology long applied in System Center Virtual Machine Management (SCVMM). This can be seen as an attempt of Microsoft to create uniform Hyper-V terminology, which would be distinct from its main competitors.
Both of these terms (Hyper-V snapshots and Hyper-V checkpoints) are equally valid; therefore, we will use both of them in this blog post. For example, the Get-VMSnapshot cmdlet and the Get-VMCheckpoint command are both functional and can be used interchangeably in PowerShell.
- Hyper-V snapshots are stored as AVHD(X) files
In Hyper-V, when a new Hyper-V snapshot is taken, a new AVHD(X) file is created, which contains only the data captured at that particular moment. Along with the differencing disk, the VM saved state files (BIN and VSV) and the snapshot configuration file (XML) are created. AVHD(X) files are stored in the same location as the original virtual hard disk.
After the snapshot is created, all the changes in data are tracked and saved in the corresponding differencing disk (AVHD(X) file) until the new Hyper-V snapshot is created or this one is deleted. At the same time, the original VHD file operates in a read-only mode.
- Hyper-V snapshots can be standard or production
Prior to the release of Windows Server 2016 and Windows 10, only one snapshot type existed – Standard. This type of snapshots can capture the VM state at a particular point time, including its memory. However, standard snapshots proved not to be sufficiently effective when applied in production environments. Due to this, Hyper-V production snapshots were introduced. The main advantage of production snapshots is that they apply Volume Shadow Copy Service (for Windows) or File System Freeze (for Linux) to create data-consistent and application-aware snapshots of the VM. Thus, Hyper-V production snapshots have proven themselves to be extremely helpful in production environments.
Note that Hyper-V production snapshots are selected by default but you can modify the snapshot type in Hyper-V Manager or PowerShell.
- Hyper-V snapshots can be used to revert system changes
Hyper-V snapshots are generally created before installing new software, adopting configuration changes, performing operating system (OS) updates, or making registry changes. Software updates and configuration changes may fail and lead to some undesirable results. Thus, it is a feasible option to create VM snapshots beforehand and use them in order to discard the adopted changes and roll back the VM to its previous state.
- Hyper-V snapshots prove to be extremely effective in test and development environments
It is clear that Hyper-V snapshots allow you to easily and rapidly revert the VM to its previous state before any damaging changes are applied. Due to this, they can be considered a feasible tool for test and development environments.
Moreover, using Hyper-V snapshots in production environment is not advisable because AVHD(X) files have the tendency to rapidly grow in size and take up extra disk space, which eventually affects your server performance.
- Hyper-V snapshots are not a backup alternative
The most important thing that you should know about Hyper-V snapshots is that they are not backups and cannot provide the same level of data protection as backup software. VM snapshots are merely a short-term solution for saving the VM state at a particular point in time but it doesn’t actually create a copy of the virtual disk. Hyper-V snapshots cannot protect against issues that might affect the host. If the VM gets damaged, created snapshots will be deleted as a result. Thus, the main virtual disk remains a single point of failure in your environment.
- Default location of Hyper-V snapshots is the folder with the original VHD(X) file
Hyper-V automatically assigns a default location for its snapshots. Generally, it is the folder which contains the original virtual hard disk and all differencing disks are automatically created in the same location as their parent disk.
However, when using Hyper-V Manager, you can choose where the snapshot configuration and snapshot saved state files for a selected VM will be stored. For this purpose, open Hyper-V Manager and make sure that there are no Hyper-V snapshots for this VM. Click Settings and select the Checkpoints category. In Checkpoint File Location, click Browse and select the folder where the files will be stored. To complete the operation, click Apply and then OK.
Consider changing the default snapshot location to another media to prevent AVHD(X) files from piling up and consuming the entire disk space.
- Hyper-V snapshots should not be deleted but merged
When you have multiple snapshots on a single host, they generally take up a lot of space, which negatively affects server performance. Because of this, you must delete Hyper-V snapshots from time to time to free up space on a Hyper-V host. However, AVHD(X) files should not be deleted directly from the system folder. Instead, they should be merged.
During the merge operation, AVHD(X) files are merged with the parent disk. After the operation is complete, the snapshot files will be deleted from the system. To merge Hyper-V snapshots, use Hyper-V Manager or PowerShell cmdlets.
- Hyper-V snapshot name should be unique
When a Hyper-V snapshot is first created, a standard name is automatically assigned to it. The default name of a Hyper-V snapshot has the following format: VM name - (MM/DD/YYY -hh:mm:ss AM\PM). This type of name can be confusing at times, especially when working with multiple Hyper-V snapshots. Therefore, we recommend you to rename VM snapshots to make them distinguishable from one another. Give each snapshot a unique name containing details about the VM state at the point of time when the snapshot was taken. Once again, Hyper-V Manager and PowerShell can be used to rename Hyper-V snapshots.
- Multiple Hyper-V snapshots can form a snapshot tree
If you open Hyper-V Manager and look at the created checkpoints, you will notice that the way they are structured resembles the form of a tree, with each branch stemming from the one which precedes it.
When you have multiple checkpoints in your infrastructure, they are not sorted out randomly but organized in parent-child hierarchies, whereby a single checkpoint is referred to as the parent of a checkpoint created after it (which is called a child). Note that a single checkpoint tree can include up to 50 checkpoints. You must monitor the state of the checkpoint tree to ensure that it doesn’t grow too much in size, because this will decrease the VM performance and reduce the disk space.
Despite the many advantages that Hyper-V snapshots have, their functionality is still not advanced enough to ensure reliable data protection. Therefore, Hyper-V snapshots can be effectively used only in certain cases such as development and testing, where you need to see the immediate results of your work and have the opportunity to revert changes in the system.
If you are looking for a reliable solution offering multiple data protection options, packed with various features, and available for a fraction of the standard price, NAKIVO Backup & Replication is one of the best choices on the market.