VMware Data Protection 5.1, Windows Server 2008 R2, and Application-Consistent Backups

vSphere 5.1 is out! Among the enhancements is the new VMware Data Protection appliance that provides basic VM backups, deduplication, and file-level restore capabilities. It plugs directly into the vSphere Web Client interface and was very easy to setup. One re-occuring problem I have with VMs running Windows Server 2008 R2 is getting an application-consistent backup. I used vRanger Pro 5.5 before VDP came out and it had problems with this also, so I’m going just come right out and point the finger at VMware since the same issue is now plaguing me in their product also. The VMware Tools VSS API/Driver/whatever-you-want-to-call-it simply does not work with Windows Server 2008 R2.

After I upgraded my datacenter to vCenter 5.1 and ESXi 5.1 all of my backup jobs quit in vRanger Pro 5.5. Upgrading has always broken this product so I simply quit using it and installed the VDP appliance (the 2TB version FYI) figuring that it would solve my issue (and save me money in maintenance contracts). Not so fast! I couldn’t get a single backup job to finish. vCenter would show a snapshot being made, the VDP job start, and right about 10% of the way through the VDP job, the snapshot would be removed and the VDP job would fail. After some investigation on the VMware forms, I learned that this was a known issue and VMware recommended shutting down each VM, editing advanced settings, and changing the setting for “disk.enableUUID” to “false”. THIS IS THE SETTING THAT ALLOWS APPLICATION-CONSISTENT BACKUPS TO FUNCTION. Are you kidding me VMware? Your backup API doesn’t work for Windows Server 2008 R2? How long has that OS been out? It would be safe to say that the majority of your customers use that OS and need to make application-consistent backups of their VMs. Get with the program!

So are we stuck with backups that may have corrupt data in them (think Exchange and/or Microsoft SQL)? I say no. There is hope! You can use a backup freeze script to stop I/O during the snapshot process and allow an application-consistent backup to be made. Here’s how:

  1. Shutdown your VM, edit the advanced settings and change “disk.enableUUID” to “false” per VMware’s instructions. http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2035736
  2. Power the VM back on.
  3. Download the Windows Server 2008 SDK and install it on your PC. http://www.microsoft.com/en-us/download/details.aspx?id=11310
  4. Included with the SDK is a program called vshadow. There is a version for x86 (vshadow_x86.exe) and x64 (vshadow_x64.exe) installs. Pick the appropriate one for your install and copy it to the C: drive of your VM. More info on vshadow here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb530725(v=vs.85).aspx
  5. Navigate to your VMware Tools folder and create a folder called “backupscripts.d”
  6. Create a batch file named “freeze.bat”
  7. In the batch file, enter a single line “C:\vshadow_xxx.exe c:” (replace xxx with x86 or x64 for which version you are using). You will need to add each drive on which you want to stop I/O to the end of the line, ex: “C:\vshadow_x64.exe c: e: f:”.
  8. Create your VDP job and run it!

You’re done! You can view the Windows Event Log and watch for the VSS activity. On an Exchange Server you will even see the log entry for “Backup Complete” and it will truncate transaction logs. This is the only fool proof way of getting application-consistent backups that I have found. New versions come every year, but this has never been fixed. Hopefully VMware will get with it soon and take care of this nagging problem. Hope this helps someone somewhere!