- How to use VMware vSAN ReadyNode Configurator - Fri, Dec 17 2021
- VMware Tanzu Kubernetes Toolkit version 1.3 new features - Fri, Dec 10 2021
- Disaster recovery strategies for vCenter Server appliance VM - Fri, Nov 26 2021
Snapshots as such are here to preserve the state of a VM at the time you take the snapshot. When you trigger the creation of a snapshot, you create a file that contains the state of the VM at that particular point in time. The VM snapshots slow the vMotion switchover process; you should always avoid unneeded snapshots on VMs.
What files are generated by a snapshot? ^
A snapshot comprises a number of files that you can view in the datastore browser after navigating to a folder in the VM for which snapshots have been taken. Use the vSphere web browser, or if running an individual ESXi host, use the ESXi host client.
We won't go into too much detail here about each of these files, as this won't teach you much that is new. However, to imagine the snapshot chain with the naming convention for child VMDKs, VMware has a nice image available in this KB.
Consolidating a VM's disks ^
Sometimes you see that you need to consolidate VM disks. You can see it in the vSphere client, and I'll show you how in a sec. What is it? It is when the VM has redundant delta disks. When the consolidation process is executed, those redundant disks are removed. This improves virtual machine performance and saves storage space.
When not using snapshots, you don't need to consolidate. Snapshot consolidation is needed when snapshot disks fail to compress after a Delete snapshot or Delete all snapshots operation. This can happen, for example, when you delete a snapshot but the associated disk does not commit back to the base disk.
The Needs Consolidation column in the vSphere web client shows the virtual machines to consolidate.
To view the Needs Consolidation column in the vSphere client, you'll need to:
- Select a vCenter Server instance, host, or cluster.
- Click the VMs tab.
- Left-click the menu bar for any virtual machine column and select Show/Hide Columns > Needs Consolidation.
The VM can have a status of Yes, which means that the snapshot files for the VM should be consolidated and that the VM's Tasks and Events tab indicates a configuration problem (yellow color). If there is no status saying Not Required, it means that all is good and there is no need to consolidate.
Some of VMware's best practices and recommendations for snapshots ^
- Snapshots are not backups, and we all know that. But not everyone knows why this is. A snapshot file is only a changelog of the original virtual disk; you'll need the base disk to fully restore. So, if the base disk is missing, lost, or damaged, it's tough luck.
- There are those delta files in the VM's folder. The delta files can grow to the same size as the original base disk file if a lot of changes are made to the VM over time. This is why the provisioned storage size of a VM with snapshots can increase by some huge number and cause problems for your datastores. Note that even to delete snapshots, you'll need free space on a datastore. If you don't have enough free space, you cannot delete your snapshot.
- A maximum of 32 snapshots is allowed. This does not mean that you have to create those 32 snapshots. In fact, VMware recommends that you use only two to three snapshots in a chain, not more.
- You should not use a single snapshot for more than 72 hours. Snapshots should not be kept over long periods of time because they grow over time with the changes to your VM.
- There are a couple of backup software products on the market that ensure there are no snapshots left behind when you back up your VMs.
- If there is a large number of delta files in a chain, a VM having many snapshots has a heavy performance impact on the applications running in those VM(s). There is also a heavy impact on host performance because the IOPS consumed by those VMs might negatively impact the performance of your storage device and hosts.
Read IOPS and write IOPS ^
Imagine that when you keep a snapshot for a VM, you basically double the amount of read IOPS. For write operations, a VM that needs to write a block that has not been written before will need twice as many write operations as well. A huge penalty indeed.
This is because VMware has to update the table that keeps the reference to the block's location, either the snapshot or the base disk. This leads to a very big performance impact.
Performance exceptions ^
There are situations where performance is not affected when running VMs with snapshots. This is the case with VMware vVols.
Snapshots on vVols are offloaded to the array that creates the snapshot using the array-side native operations. The snapshots are handled by the array and the copy-on-write (COW) operations that are needed to maintain the snapshot. As a result, the I/O from the VM to the disk does not have the performance penalty because the VM is running on an active snapshot.
Subscribe to 4sysops newsletter!
As a second case, we could say that with native snapshot support (fast file cloning), where you can create VM-linked clones (only for VMs with virtual hardware 9 and higher), the VMs use native snapshot disks instead of VMware redo logs.