Subscribe to Windows IT Pro
March 07, 2003 12:00 AM

The Volume Shadow Copy Service

Windows IT Pro
InstantDoc ID #38305
Rating: (0)

Every parent of a toddler knows how difficult it is to take a snapshot of something that keeps moving. This fact is also true for Exchange Server: As long as a mailbox or public folder store is mounted, the store can write new transactions at any time. Therefore, any attempt to capture a point-in-time copy of the database is liable to fail or only partially succeed. As I mentioned in last week's Commentary, "The Quest to Speed Restores," the upcoming Microsoft Volume Shadow Copy Service (VSS)--which will be available in Exchange Server 2003 (formerly code-named Titanium) and Windows Server 2003--offers a solution to that problem.

Actually, traditional point-in time copy methods present two problems. The first problem is that data might change during the copy process. Consider a typical .edb file. At the start of the file is a database header (which you can view by using the eseutil /mh command). This header indicates whether the file was dismounted cleanly and when it was last backed up. When you dismount a database, the header is the last thing the store updates before it closes the .edb file. When you mount the database, Exchange reviews the header. If the header signature doesn't match the file's contents, the database won't mount. Now, imagine that you're making a copy of the .edb file. You copy the first 100MB, but a transaction arrives that includes a change to a page you've already backed up. If you go back and attempt to copy every page that changes after you copy it, your copy might never finish; if you don't try to recopy the page, the point-in-time copy will probably be inconsistent with the header, and the copy won't mount in the future.

The second problem is subtler. Microsoft has long recommended putting .edb and log files on separate volumes; depending on your server configuration and load, putting .stm files on yet another volume might be appropriate. When you follow this recommendation, however, any point-in-time copy solution that copies one volume at a time can cause consistency problems. Suppose that you copy the transaction logs first. Any new transaction that arrives while you're copying the .stm files won't make it into the copy.

You can alleviate both problems by dismounting the storage group (SG) before making a point-in-time copy. However, doing so largely negates the value of copying as a quick backup mechanism (at least if you want to perform backups during hours when users are active).

Enter VSS. VSS calls applications (such as backup utilities) that need data copies from other applications "requestors." When a requestor needs a data copy from an application, the requestor places a request to VSS, which reviews the request for validity. If the request is valid and the specified application has the requested data, the request goes to the application-specific "writer," which prepares the requested data. Each writer integrates with a particular application and has intimate knowledge of how the application works. The Exchange team, for example, is providing the Exchange 2003 writer to ensure that the writer will know how to properly prepare an Exchange SG or database.

After the writer signals that it has prepared the data, VSS freezes I/O writes to the selected volumes, queuing them for later processing, then calls a "provider" to make the actual copies. The provider, which is usually associated with a particular piece of hardware (e.g., a XIOtech MAGNITUDE disk array), copies the prepared data to the target location. The provider then signals VSS, which releases I/O to the selected volumes and processes any queued writes that arrived during the provider's work.

Windows 2003 and Exchange 2003 are still in beta, so it's too early to tell which vendors will embrace VSS. In the meantime, consider whether your organization might benefit from the speed of VSS-driven backups and restores. Bear in mind that VSS requires Exchange 2003 running on Windows 2003, disk hardware on which to keep your point-in-time copies, and a supported VSS provider (plus whatever hardware the provider might require). To read more about VSS, look in Windows 2003 online Help (looking up the vssadmin command-line utility is a good place to start your search) or go to the following URL: http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/datacenter/ntbackup_backup_snapshot.asp

Related Content:

ARTICLE TOOLS

Comments
  • Jerry Jay
    9 years ago
    Jul 20, 2003

    Our company is looking for a way to do restoration of VSS from command line, I checked vssadmin, but It just be able to create new shadow copies, not to retrieve old volume

  • Eric Romero
    9 years ago
    Apr 14, 2003

    what are the prerequistes for this VSS to work in an Exchange2003 server? how can I restore individual mailboxes based on VSS? what is the benefit over the current online ntbackup? can we use this VSS for exchange2000?

    the portion that says "VSS freezes I/O writes to the selected volumes" ..shoud I understand that during the forzzen activity no email messages will flow neither locally nor extrenally to the exchange2003?

  • Geoff Haynes
    9 years ago
    Mar 15, 2003

    You state that a point-in-time copy might fail because it would continually be re-copying parts of the edb file which had been updated with transactions since the copy began. This is not my understanding of how a true point-in-time copy works. Any copy program which operates in the way you describe is not working in point-in-time mode at all.

    By definition, a point-in-time copy takes a snapshot of the data to be copied as it appears at the time the copy commences. Any changes to the data subsequent to the start of the snapshot will not (and in fact must not) be copied if the copy is to be a true point-in-time snapshot. The snapshot copy program works this 'magic' by intercepting all disk I/O requests, checking to see if they involve a write operation to data blocks within the extents of the file(s) being copied. If so, the snapshot program takes a copy of the existing data blocks if they have not already been copied, then permits the disk write operation to proceed for those data blocks. It is this technique which allows a true point-in-time backup, regardless of changes which may occur subsequent to the commencement of the copy while it is in progress.

    The complications which arise with Exchange Server (and most other database servers) is that transaction logs, indexes and data files cannot be guaranteed to be synchronised at the instant of commencing the snapshot. These programs also typically use caching techniques to optimise I/O performance, and if the cached data isn't flushed to disk before the snapshot commences, then the image cannot be a true point-in-time snapshot either. This is why snapshot copy programs need to quiesce database/mail servers momentarily to ensure that caches are flushed and transaction logs, indexes and data files are all in sync. Once that is done, the server program can be immediately resumed and the point-in-time copy can proceed in parallel with dynamic updates to the files in question, without affecting the integrity of the snapshot image.

    It would appear that VSS incorporates the same techniques of well-behaved third party snapshot copy software, and additionally removes the need to temporarily quiesce the application software in order to guarantee file synchronisation.

    I welcome further comments.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.