Microsoft introduced the Volume Shadow Copy Service (VSS) as part of Windows Server 2003. VSS lets you coordinate necessary actions to create a consistent point-in-time copy (also known as a shadow copy or snapshot) of data for backup purposes. It allows you to create manual or automatic backup snapshots of data and coordinates with properly registered applications and services. VSS can (for example) be used to take periodic, point in time snapshots of a file server to give remote users the ability to restore old copies of their files.
To create a snapshot, a VSS requestor (backup utility) requests that an image be created. The VSS provider (comes with Windows Server) coordinates with application specific VSS writers to coordinate and “freeze” application data for snap shot creation. Microsoft SQL Server and Exchange have VSS writers, as do many of the service that ship with Windows Server (including Active Directory, DHCP,WMI, and lots of others).
With Windows Server 2008, Microsoft included a VSS writer for Hyper-V which enables consistent snapshots to be created of VMs running on Hyper-V! Microsoft also added a new command line tool for administrators to manage this VSS process called DiskShadow (more on this cool command in a later post).
When a VSS aware backup utility requests a backup of a system running Hyper-V, the system coordinates with the a VMs to “quiesce” disk IO. There are two ways that a VM can be consistently backed up Hyper-V depending on the VMs level of “integration” with the host.
Once the snapshot is generated, the consistent image of virtual machines and their configuration can be exposed to the requestor (the backup utility) and restorable data can be copied off for later use. Keep in mind that all the storage for a VM using a host-base backup must be leveraging VHDs for storage (not pass-through disk or iSCSI), otherwise the host can’t take an image of the VMs. The files and data that is captured can be used to quickly and easily restore the virtual machines and their configuration.
If you want more details of how VSS works with Hyper-V, check out MSDN. In my next post, I’ll describe a simple backup process you can use that takes advantage of the diskshadow command line tool.