Managing VSS Settings Using VSSAdmin
Volume Shadow Copy Administrative Command-line Tool (VSSAdmin) can be used to create and delete volume shadow copies/associations, list shadow copy providers and writers, and resize a volume shadow storage association.
The VSSAdmin is used to manage the VSS. Before you take a closer look at this tool and the information it provides, it's important that you have a good understanding of VSS and its components.
The VSS coordinates several components, which allow you to back up your server without impacting running applications or users. It accomplishes this through the use of shadow copies. A shadow copy (also called a snapshot ) of a volume is a duplicate of the data on the volume at a specific point in time.
The VSS components communicate with each other via the VSS Framework to both create and restore your shadow copies. The following provides a brief overview of the tasks performed by each component:
- VSS requester:
Requests that a shadow copy be taken. The Windows Server Backup program and the System Center Data Protection Manager are examples of VSS requesters. - VSS writer:
Makes sure the data is ready for the shadow copy to be created. The writer is usually provided by the application software itself and each Windows Server has one or more writers. Examples of VSS writers include Hyper-V, SQL Server, Exchange Server, Active Directory System Service, Performance Counter Writer, ASR Writers, System Writer, Registry Writer, WINS Jet Writer, DHCP Jet Writer, WMI Writer, Certificate Authority Writer, NTDS Writer, and so on. - VSS provider: Creates and maintains the shadow copies. Examples of VSS providers (fileshare and system types) include the Microsoft File Share Shadow Copy provider and the Microsoft Software Shadow Copy provider. Hardware vendors also include VSS providers with their storage arrays.
- Source volume:
Contains the data you want to copy. - Storage volume:
Holds the shadow copy storage files for the VSS provider.
The following provides a basic overview of how VSS components interact with each other during a typical backup:
- When you launch Windows Server Backup (VSS requester), it queries the VSS and asks it to list the VSS writers.
- Each VSS writer then describes the components and data stores that need to be backed up and provides the information to VSS. VSS provides the information to the VSS requester (for example, Windows Server Backup), which then selects the components to back up.
- VSS then notifies all VSS writers to prepare their data in order to make a shadow copy. Preparing the data involves completing any open transactions, flushing their caches, and/ or rolling any transaction logs. Once the VSS writer has completed its pre-backup tasks, it informs VSS.
- VSS tells the VSS writers to quiesce (pause) their data and temporarily queue any I/O write requests from applications. This is necessary to ensure a consistent backup and allows VSS to create a shadow copy of the volume. The VSS freezes the file system to ensure its metadata is written in a consistent order.
- The VSS provider tells VSS to create the shadow copy.
- After the copy is complete, VSS unfreezes the file system and releases the VSS writers, which allows them to process their queue of I/O write requests.
- VSS then queries the VSS writers to make sure they held I/O write requests during the time period the snapshot was taken. If they did not, the shadow copy is deleted and Windows Server Backup (VSS requester) is notified. If the VSS writers handled their queues appropriately, VSS provides Windows Server Backup (VSS requester) with information on where it can locate the shadow copy.
When an application attempts to write to the protected sector, VSS makes a copy of the sector before it allows the application to write to it. The copied sector is the one stored in the backup.
Now that you have a better idea of the components that make up VSS and how they interact with each other, you can use the VSSAdmin to view the list of writers and providers on your server, see a list of volume shadow copies on your server, and view how much storage space (currently, in the future, and maximum) is used by shadow copies.
MANAGE VSS SETTINGS USING VSSADMIN
To manage VSS settings using VSSAdmin, perform the following steps:
- Log in to Server01 with administrative privileges.
- Open a command prompt.
- Type the following to see a list of commands supported with vssadmin:
c:\vssadmin /?
- Type the following to see a list of VSS writers on Server01 and their current state.
c:\vssadmin list writers
If this were a server and you noticed one or more of the VSS writers with a state set to Failed, you can most likely fi x them with a quick server reboot. In situations where you cannot reboot the server, you can search the registry or the Internet for the Writer ID to identify the service associated with it. You can then restart that specifi c service and rerun the list writers command to confirm the fix. - Type the following to see a list of VSS providers on Server01:
c:\vssadmin list providers
- Type the following to see a list of existing volume shadow copies:
c:\vssadmin list shadows
- To list the volumes that are eligible for shadow copies, enter the following:
c:\vssadmin list volumes
- To view used, allocated, and maximum shadow copy storage space, type the following:
c:\vssadmin list shadowstorage
After running the command, you see the amount of shadow copy storage space being used, the amount allocated for the future, and the maximum space that can be used. If you notice the amount of storage space that is being used is almost as large as the maximum, you might need to move the VSS storage area to another location. This can be accomplished by accessing the computer's volume that is currently used for the volume shadow copy storage area, rightclicking it, and selecting Configure Shadow Copies . Select Settings and then choose another volume to store the shadow copies on.