Hyper-V vss-writer not making current copies
- by Martinnj
I'm using diskshadow to backup live Hyper-V machines on a Windows 2008 server.
The backup consists of 3 scripts, the first will create the shadow copies and expose them, the second uses robocopy to copy them to a remote location and the third unexposes the shadow copies again.
The first script – the one that runs correctly but fails to do what it's supposed to:
# DiskShadow script file to backup VM from a Hyper-V host
# First, delete any shadow copies of the drives. System Drives needs to be included.
Delete Shadows volume C:
Delete Shadows volume D:
Delete Shadows volume E:
#Ensure that shadow copies will persist after DiskShadow has run
set context persistent
# make sure the path already exists
set verbose on
begin backup
add volume D: alias VirtualDisk
add volume C: alias SystemDrive
# verify the "Microsoft Hyper-V VSS Writer" writer will be included in the snapshot
# NOTE: The writer GUID is exclusive for this install/machine, must be changed on other machines!
writer verify {66841cd4-6ded-4f4b-8f17-fd23f8ddc3de}
create
end backup
# Backup is exposed as drive X: make sure your drive letter X is not in use
Expose %VirtualDisk% X:
Exit
The next is just a robocopy and then an unexpose.
Now, when I run the above script, I get no errors from it, except that the "BITS" writer has been excluded because none of its components are included. That's okay because I really only need the Hyper-V writer. Also I double checked the GUID for the writer, it's correct.
During the time when the Hyper-V writer becomes active, 2 things will happen on the guest machines:
The Debian/Linux machine will go to a saved state and restore when done, all fine.
The Windows guests will "creating vss snapshop-sets" or something similar.
Then X: gets exposed and I can copy the .vhd files over.
The problem is, for some reason, the VHD files I get over seems to be old copies, they miss files, users and updates that are on the actual machines.
I also tried putting the machines in a saved sate manually, didn't change the outcome.
I hope someone here has an idea of how to solve this.