What is VSS?

So what is VSS? or to give it its full name “Volume Shadow Copy Service”. It first appeared in Windows XP, and is a Windows Based Service that allows you and backup applications to create a consistent copy of your data on a Volume, that can then be used to protect the data on that volume.

Lets go back in time, before VSS, if you wanted to get a consistent copy of a database, Exchange or any open files, you had to shut down the database or Exchange, do a backup and then start up the services once the backup had completed, and you had no chance of backing up an open file, which always seemed to be an important file that you really needed to backup, like your Bosses expenses.

What VSS allows Windows and Backup applications to do is take a snapshot of the data so it is in a consistent state and then backup up the snapshot, so no issues with open files or databases.
The most obvious way you will use VSS in a Windows File System is with the Previous Versions option. If you take a snapshot of your file system at midday and then at 2pm you accidentally delete/overwrite a file you had been working on in the morning you just have to look at your previous versions to get a copy back from the snapshot.

There are 3 components to how VSS works, these are:
Requestor: Your Backup Software
Writers : SQL, Active Directory,Oracle, Sharepoint, Exchange
Provider: The Operating System or Storage Array

It might be easier to understand if we go through what a Requester, your backup software, does during Backup on a Windows Server
1. Connects to the VSS API interfaces on the server to be backed up
2. Contacts the writers/application and retrieves their information.
3. Chooses data to back up.
4. Request a shadow copy from the Windows Server (the provider)
5. Backs up the data.
6. Releases the connection and the shadow copy.

So what is happening on the Windows Server
1. PrepareForBackup
2. PrepareForSnapshot
3. Freeze & Thaw, these events make the writers put their files in a stable state prior to shadow copy.
4. PostSnapshot
5. BackupComplete
6. BackupShutdown

So while a shadow copy is in existence, the provider (Windows or your Storage Array) creates an environment where there are effectively two independent copies of any volume that has been shadow copied: one the running disk being used and updated as normal, the other a copy that is disk fixed and stable for backup.

A default provider is supplied as part of Windows, other vendors are free to supply their own versions of VSS that are designed for their own storage hardware and software applications.From your point of view or from your backup/restore application, all providers will have the same interface.

In Windows 2008 and later you can now see what snapshots you have on your system by using DiskShadow.exe, below is some of the options, but remember to be careful with these you don’t want to accidentally revert to a previous version of a live volume, your users aren’t going to tank you for that.
List – Lists VSS writers, VSS providers and shadow copies
Create – Creates a new shadow copy
Import – Imports a transportable shadow copy
Expose – Exposes a persistent shadow copy (as a drive letter, for instance)
Revert – Reverts a volume back to a specified shadow copy

I hope this has helped with you understanding the basics of VSS, you generally don’t have to worry about it, it will just sit in the background doing its thing and helping you get good consistent copies of your data.

Leave a Reply

%d bloggers like this: