Ah, the joys of encountering distinct technologies that share a name. There’s nothing at all confusing about that, is there? Today, we’ll look at the differences between Hyper-V’s snapshots and VSS’s snapshots. They do have more in common than just a name, but they have far more differences.
Hyper-V’s snapshot, also called a “checkpoint” in some places (System Center Virtual Machine Manager), is intended to provide rollback capability for a virtual machine. To use this technology, you instruct Hyper-V Manager, SCVMM, or PowerShell to create the snapshot. .AVHD[X] files are created for each .VHD[X] file attached to the virtual machine. All data changes that would normally go into the .VHD[X] files are written to these files instead. When the virtual machine requests data, it is retrieved from the file that contains the most recent change. .AVHD[X] files work similar to the fashion of a database log file, tracking absolutely everything that happens. Additionally, all changes to the virtual machine’s configurations are tracked. The only part of a virtual machine it can’t work with are pass-through disks. These lie completely outside the control of the hypervisor so it has no mechanism for snapshotting the data that’s on them.
The Volume Shadow Copy Service (VSS) is a component of every modern Windows operating system. Backup applications interact with this service to trigger snapshot events. When this event occurs, VSS notifies Windows to flush all read/write buffers so that no disk I/O is in memory. It then begins a snapshot process. Once the snaphot is taken, I/O is resumed. I am not an expert on the methodologies that VSS uses to protect data and will not pretend that I am. It utilizes a block-level system to ensure that the backup applications are able to read out a copy of the volume’s data exactly as it was at the point that the snapshot was taken without worrying about file locks. Read and write operations continue as normal and the backup application is free to take as much time as it needs to copy out this data. Additionally, applications can register with VSS so that they are notified when a VSS snapshot is about to occur and when it has completed. These applications can then flush their own buffers and perform any other tasks they wish.
How Hyper-V Snapshots and VSS Snapshots are Similar
The only major similarity between the two is that they redirect active I/O in such a way that a base image remains in read-only mode. They do it for different reasons, though. VSS only does it so that a backup application can pull the read-only copies out for long-term storage. Hyper-V does it so a virtual machine can have a complete rollback point. While these are similar, they aren’t quite the same thing.
Another similarity is that they can both occur in real-time. There is some interruption, but it’s usually minimal and rarely impacting.
How Hyper-V Snapshots and VSS Snapshots are Different
Most of the differences can be seen in a quick list:
- VSS snapshots are disk only. Only the data on the disk is captured in the VSS snapshot. Anything in memory is lost. A Hyper-V Snapshot gets absolutely everything that was happening at the moment the snapshot was taken, except for data on a pass-through disk. If you take a Hyper-V Snapshot and then add a virtual network adapter and double the allocated RAM, those settings will be reset if you roll back to the snapshot.
- Hyper-V Snapshots are not intended for backup. One warning you will see Hyper-V experts repeat over and over is that Hyper-V snapshot is not a backup. VSS is really intended only for backup.
- You can create chains and trees of Hyper-V snapshots. With VSS, there is only one snapshot at a time. You can make as many Hyper-V snapshots as you want. You can restore to an older one and make snapshots underneath that:
- Rolling back to a Hyper-V snapshot is easy. From the screenshot above, you can just right-click on any entry and hit “Apply…” Go through the dialogs, and the virtual machine is restored exactly as it was when that snapshot was taken. For VSS, you need to go through your application’s restore functionality. No matter how well it works, it won’t be exact because the memory contents are lost. If it’s “bare metal”, then you’ll have to manually turn on the restored system and then it will want to know why it crashed.
- VSS snapshots occur on the volume where they are taken; Hyper-V snapshots occur separately. The VSS snapshot is placed on blocks inside the volume where it occurs (this is not true for hardware-assisted snaps).
- VSS has hardware-assisted snaps. Usually this is only available on SAN devices, but it’s convenient when available.
- Hyper-V snapshots are user-controllable. You can say when and where a Hyper-V snapshot occurs and when it gets destroyed. For better or worse, VSS takes care of its own backyard.
- Aging Hyper-V snapshots are performance and space problems. VSS keeps a pretty close watch on its behavior and will eventually clean up, almost always without impact. A Hyper-V snapshot causes performance problems, especially if you tree them out as above and as they age. Because the .AVHD[X] file is tracking changes, there can be a lot of data to look through for active I/O. If you let it go too long, the .AVHD[X] can consume all available space in its container and that will at least cause its owning virtual machine to stop as well as any others in the same storage space.
- 2008 R2 and below Hyper-V Snapshots require downtime for cleanup. The snapshots would stop tracking changes when deleted, but the files would remain until the VM was powered off. If the VM was turned back on before the merge completed, the files would remain. VSS snapshots clean up on their own without downtime (as do Hyper-V snapshots in 2012).
- Restoring to a VSS snapshot can be non-destructive. This is a bit misleading as you don’t exactly restore to the VSS snapshot in the same way that you do a Hyper-V snapshot. You usually invoke an application’s restore process (or Previous Versions). However, you get access to such settings as “Don’t Overwrite” and “Overwrite only if newer”. With a Hyper-V snapshot, you either revert or you don’t.
Is Your Office 365 Data Secure?
Did you know Microsoft does not back up Office 365 data? Most people assume their emails, contacts and calendar events are saved somewhere but they're not. Secure your Office 365 data today using Altaro Office 365 Backup - the reliable and cost-effective mailbox backup, recovery and backup storage solution for companies and MSPs
Not a DOJO Member yet?
Join thousands of other IT pros and receive a weekly roundup email with the latest content & updates!