Backing up entire virtual machines.

982860 pts.
Virtual Machines
Virtual Server Backup
I want to backup all my virtual machines, as a whole. Not just files on a virtual machine, I want to grab the whole virtual machine. Is there a way to automate this? I have about 10 virtual servers, each has between 2-5 virtual machines running. I am using Hyper-V

Answer Wiki

Thanks. We'll let you know when a new response is added.

Ok so you want to back up entire virtual machines. I have two methods for you one old and one new using a new tool. The later would be accomplished by Invoking diskshadow and this will back up a Virtual Machine from a Hyper-V Host. Let;s start with the old fashioned way first:

To back up Hyper-V virtual machines from the parent partition on Windows Server 2008 by using Windows Server Backup, you must register the Microsoft Hyper-V VSS writer with Windows Server Backup.

To register the Hyper-V VSS writer with Windows Server Backup, follow these steps:

1. Click Start, click Run, type regedit, and then click OK.
2. Locate the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
3. Right-click CurrentVersion, point to New, and then click Key.
4. Type WindowsServerBackup, and then press ENTER.
5. Right-click WindowsServerBackup, point to New, and then click Key.
6. Type Application Support, and then press ENTER.
7. Right-click Application Support, point to New, and then click Key.
8. Type {66841CD4-6DED-4F4B-8F17-FD23F8DDC3DE}, and then press ENTER.
9. Right-click {66841CD4-6DED-4F4B-8F17-FD23F8DDC3DE}, point to New, and then click String Value.
10. Type Application Identifier, and then press ENTER.
11. Right-click Application Identifier, and then click Modify.
12. In the Value data box, type Hyper-V, and then click OK.
13. On the File menu, click Exit.

Sp the second method I spoke about is using DiskShadow.exe, it is a brand spanking new tool that is shipping with Windows Server 2008. It will let you create and restore shadow copies (snapshots). Those snapshots can be of each of your VM’s.

The tool is similar to vshadow (a free tool that ships with the Volume Shadow Copy/VSS SDK), but it has a diskpart-like interface.

DiskShadow can be run either from a cmdline, or you can pass a script to it using the command
“diskshadow -s script.txt”</b>

Below, i will show you an example script to back up all VMs of a Hyper-V Host. First, we need to know the ID of the VSS writer for Hyper-V. To do that you need to invoke the command “list writers” from diskshadow (or from vssadmin). Once you parse its content, look for this GUID as per below underlined text.

* WRITER “Microsoft Hyper-V VSS Writer”
– Writer ID = {66841cd4-6ded-4f4b-8f17-fd23f8ddc3de}
– Writer instance ID = {d49be452-e26e-4255-a723-bfb9f996e703}

Once you know the ID, you can use a script like one below to create a snapshot for the volume the VM resides on and ensure that the VSS writer for Hyper-V is included in the snapshot process.


# DiskShadow script file to backup a single VM from a Hyper-V host
set context persistent

# make sure the path already exists
set metadata c:\
set verbose on

begin backup
add volume d: alias SystemAndDataVolumeShadow

# verify the “Microsoft Hyper-V VSS Writer” writer will be included in the snapshot
writer verify {66841cd4-6ded-4f4b-8f17-fd23f8ddc3de}

end backup

Discuss This Question:  

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: