This is a guest blog post from Altaro Software (http://www.altaro.com/hyper-v-backup/). Altaro Software are the developers of a Microsoft Hyper-V backup solution called Altaro Hyper-V Backup. Altaro Hyper-V Backup includes a freeware edition – a 5 minute YouTube demo can be seen here: http://www.youtube.com/watch?v=mwxhHBOeS1g

 

With Windows Server 2008, Microsoft retired the venerated NTBackup utility and replaced it with Windows Server Backup (WSB). Microsoft has never intended for this free offering to compete with dedicated professional backup software and WSB does not change that approach at all. It is intended as a stop-gap backup measure or for simplistic deployments that don't justify a paid solution.

 

Setting up WSB to cover Hyper-V guests is pretty straightforward. You have two options: GUI mode or command-line mode. If you're using a native deployment of Hyper-V or running it as a role within Server Core, you can't install the GUI version, but, if you enable the WSB feature, you can connect to and manage it from a full GUI installation on another server.

 

GUI installation:

  1. Click the “Server Manager” icon in the quick launch area or under Start->All Programs->Administrative Tools.
  2. Select “Features” from the tree, then the “Add Features” link in the center pane.
  3. Place a check mark in “Windows Server Backup Features”. If you wish for finer control and more functionality, also check “Command-line Tools”. This article does not dive into detail on how to utilize these tools.
  4. Click the “Next >” and “Install” buttons.
  5. “Windows Server Backup” is installed as an icon under Start->All Programs->Administrative Tools.

image001.png

Hyper-V/Core installation:

  1. Type the following (feature names are case-sensitive):
    DISM /Online /Enable-Feature /FeatureName:MicrosoftWindowsPowerShell /FeatureName:WindowsServerBackup

By default, Windows Server Backup doesn’t work with Hyper-V’s VSS writer. Without these keys, VMs will be paused for backups. Note that if the VM doesn’t run a supported version of Windows (Vista or later on desktops and 2003 or later on servers) or if the Backup integration service isn’t offered, VMs will be paused anyway.

 

Registry modifications for WSB to work with Hyper-V guests:

  1. Observe the typical warnings about how tinkering with the registry can ruin your server, day, and career. Be careful in there.
  2. Choose one of the two following methods:
    1. Manual entry (from TechNet blog in Consulted Sources)
      1. In HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support, add a new key named {66841CD4-6DED-4F4B-8F17-FD23F8DDC3DE}
      2. Inside that new key, create a String Value (REG_SZ) named “Application Identifier” and give it a value of “Hyper-V”
    2. Scripted entry (from Mark Wilson’s recorded video on TechNet, also in Sources):
      1. In a text editor, create a batch file called “hyper-v-vss.bat” and paste in the following two lines:
        1. reg add “HKLM\Software\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support\{66841CD4-6DED-4F4B-8F17-FD23F8DDC3DE}”
        2. reg add “HKLM\Software\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support\{66841CD4-6DED-4F4B-8F17-FD23F8DDC3DE}” /v “Application Identifier” /t REG_SZ /d Hyper-V
      2. Execute the batch job as an administrator

 

Setting up a backup job is equally simple.

  1. If you’ll be managing another server, notably one without a GUI, use the “Connect to another server…” link in the right pane. Fill in the name of that computer and click OK.
  2. Click “Backup Schedule…” in the top right, and “Next >” on the introductory screen.
  3. You can choose to back up the entire host, which will cover your virtual machines. The rest of the screens are fairly self-explanatory. A possible exception might be the destination screen, which gives an option to back up to a dedicated drive. This is only applicable to a drive that the host considers to be local. If the target drive is on a NAS device, then it needs to be set up as a shared drive.
  4. If you choose to perform a custom backup, then on the first screen, click “Advanced Settings” and switch to the “VSS Settings” tab. Ensure the dot is set to “VSS full Backup” (you can read the descriptions here for explanations).
  5. WSB does not work at the VM-level. To back up the guests in a custom job, you must select the volumes that the VHD(s) and configuration files are placed on. Once the Hyper-V VSS writers are enabled, WSB does talk to Hyper-V as an application and at the host volume level, so attempting to use exclusions to narrow down which VMs are being backed up is not supported and will likely result in disaster.

 

Benefits of WSB

  1. Because it invokes the Hyper-V VSS writer, guest VMs with VSS enabled are backed up without pausing and know they’ve been backed up; SQL and Exchange databases are committed.
  2. Zero financial cost.
  3. VSS is a block-level approach, so backups after the first one only track changes from the previous backup. These backups are generally very fast.

 

Why Not to Use WSB to Back Up Hyper-V

As mentioned in the opening paragraph, Windows Server Backup is not intended to replace commercial backup products. Its support for Hyper-V is more or less coincidental; WSB can talk to WSS-enabled applications and Hyper-V is a WSS-enabled application. There are significant and numerous reasons to not use WSB:

  1. It absolutely does not work with Cluster Shared Volumes (CSV).
  2. Unless you only wish to backup and restore your entire Hyper-V deployment, WSB can be very difficult to use. You need to use PowerShell and/or WMI just to find out which VMs were backed up.
  3. Scheduled backups always overwrite or modify the existing backup. You can’t restore to any backup except the very latest. To get around this, you have to run manual backups or setup PowerShell scripts to manipulate WSBADMIN.
  4. You can only restore to the host that created the backup.
  5. You can only backup/restore all VMs on a volume, not individual VMs.
  6. Restores will fail if a VM contains multiple snapshots (review the TechNet article below for a workaround).

The most important reason not to use WSB for Hyper-V is that there are free alternatives even for small environments. If you don’t mind command-line scripting, you can use the DiskShadow utility that is already included within Windows. In addition to being command-line only, this tool also shares some of WSB’s limitations. For one or two virtual machines, Altaro Software provides a free edition that overcomes all of WSB and DiskShadow’s shortcomings. The paid edition is inexpensive enough to fit the budget of even the smallest organizations.

 

Consulted Sources:

Altaro Software for Hyper-V Backup (with Free Edition): http://www.altaro.com/hyper-v-backup/

Manually entering registry settings to enable the Hyper-V VSS writer for WSB: http://blogs.technet.com/b/askcore/archive/2008/08/20/how-to-enable-windows-server-backup-support-for-the-hyper-v-vss-writer.aspx

Building a script for enabling the Hyper-V VSS writer for WSB (as well as some WMI/PowerShell coverage): http://technet.microsoft.com/en-us/windowsserver/dd775213

DiskShadow: http://technet.microsoft.com/en-us/library/cc772172%28WS.10%29.aspx

 

Altaro Software – Hyper-V Backup Solutions

To learn more about Altaro Software and their Hyper-V Backup solutions head over to the Altaro site (www.altaro.com) and download a 30 day trial.  If you have a small setup you can also download the Altaro Hyper-V Backup – Freeware Edition.