Having recently upgraded my home lab to ESXi 5.1, I’ve noticed that a number of VMs have stopped backing up via VDP.  The symptoms were that the snapshot was created, the VDP job would reach 10%, then the snapshot would get removed and the job would fail.

After checking some logs, I noticed this error – E10055:failed to attach disk.  Some investigation revealed KB article 2035736, but the solution there essentially involves disabling VSS, leaving only a file-system consistent backup.  A number of my VMs run databases like MS SQL server or Exchange 2010, and turning off VSS was just asking for trouble.

Some searching for alternatives revealed this blog post, but some of the information there is not quite correct for Windows 2008 R2 virtual machines.  So here’s what I did instead:

  • remove the disk.EnableUUID entry in the vmx file, as per the vmware KB article 2035736
  • create C:\windows\pre-freeze-script.bat 
  • create C:\windows\post-thaw-script.bat

The pre-freeze-script.bat contained these lines (add additional drive letters at the end of the last line):

echo off
echo Pre-Freezing at %date% %time% >> C:\vcb.log
vssadmin create shadow /For=C:

post-thaw-script.bat contained this (again, make sure to add any additional drive letters after C:):

echo off
echo Post-Thawing at %date% %time% >> C:\vcb.log
vssadmin delete shadows /For=C: /quiet

So now my VDP backups work, and they’re creating backups with an application-consistent backup.  Perfect!