4

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:

  1. The Debian/Linux machine will go to a saved state and restore when done, all fine.
  2. 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.

2
  • 1
    I think you'd do better over at ServerFault. I'll start the migration process. Oct 5, 2012 at 6:07
  • Are there any useful events logged in the Windows Application event log? Sep 26, 2014 at 1:18

1 Answer 1

0

I see that this hasn't been answered for a long time, so I'll assume that there was no solution or VSS agent is faulty.

Instead of using scripts, I'll propose another solution for you that might just help. My friends have been telling me about this free nice tool that is specifically used to backup Hyper-V guest machines from Windows, I'd recommend you to use it and see if it gets you better functionality that what you're using now.

http://www.veeam.com/virtual-machine-backup-solution-free.html?ad=menu

Thanks,

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .