Matthew Hodgkins in
Mar 10th, 2010 |
There are two reasons you may want to enable serialized (one at a time) backups of Hyper-V Virtual Machines on your DPM server:
- You have all your Hyper-V Virtual Machines stored on a Clustered Shared Volume (CSV) and do not have a hardware VSS provider. You will notice that some of your VM’s often get a Recovery Point Creation Failed error. If you look at the DPM error log you will notice an error which says:
Failed to prepare a Cluster Shared Volume (CSV) for backup as another backup using the same CSV is in progress. (ID 32612 Details: Back up is in progress. Please wait for backup completion before trying this operation again (0x8007173D)
The Backup error when trying to do backup multiple=
- You are concerned about VM and network performance if you are backing up multiple VM’s at the same time.
- You are using a Microsoft Storage Server to host your SAN. The VSS hardware providers for the iSCSI Targets do not support auto-recoverable snapshots.
To enable serialized Hyper-V backups you can change a registry key on the DPM server which is directly backing up your Hyper-V servers:
- Go to Start > Run and type in regedit
- Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Data Protection Manager\2.0\Configuration\MaxAllowedParallelBackups
- Edit the Microsoft Hyper-V key and change the Value data to 1 (if you do not have this key, make a DWord (32-bit) Value with the details mentioned)
The Microsoft Hyper-V DWord should now have the value of 1, allowing only 1 backup at a time
- Now we need to make a shared folder on the DPM server so the PowerShell script run on a clustered node can drop an XML file into the share. Share the C:\Program Files\Microsoft DPM\DPM\Config folder on with a share name of DPMConfig. Give your domain services account full permission to this folder. We are using SSW-VM\WindowsService as our domain service account (the name of this service account is important for when we schedule the PowerShell script)
Configure a shared folder called DPMConfig and give your domain services account access
You then need to setup a PowerShell script on one of your cluster nodes:
- Take this PowerShell Script ListVMsOnClusterForDPM, extract it and put it in a folder a node in your Hyper-V cluster. This script was taken from the DPM2010BetaProtectingHyperV.docx file that came with the DPM Beta. I edited it to allow the script to place the list of VMs in the xml file directly onto the DPM server. Please enter a DPM server name at the top of the PowerShell script after the variable $DPMServerName in the quotation marks. It should read similar to:
$DPMServerName = “dpmserver.yourdomain.local”
- Open up PowerShell with administrator rights on the node you copied the script to and run the following command: Set-ExecutionPolicy RemoteSigned
This will allow you to run the PowerShell script on this server
- From the same PowerShell console, cd into the directory where you stored the script and run it using .\ListVMsOnClusterForDPM.ps1
- Make sure the DataSourceGroups.xml file was created in your DPM servers C:\Program Files\Microsoft DPM\DPM\Config folder
- Now we need to schedule the PowerShell script so that it runs every few hours so that DPM knows about new or removed VM’s on the cluster. Open Task Scheduler on the node you put the PowerShell script on.
- Click on Create Task and follow the steps in this image:
Configure the Scheduled Task with the specified options
- Click on the Triggers tab and click on New… then follow the steps in this image:
Configure the Trigger with the specified options
- Click on the Actions tab and click on New… then follow the steps in this image:
Configure the New Action with the specified settings
- When you press OK on the Create Task window you will be asked for the service account password. Enter the password.
- Right click on the new task and click on Run and then your Last Run Result is (0×0) and that the DataSourceGroups.xml has been created on the DPM server.
- If a protection group has already been created for the virtual machines, run through the Modify Protection Group Wizard. If a protection group has not been created, create a new protection group and the above job serialization will come into effect.
Now the DPM server will only backup one Hyper-V server at a time, allowing for successful, non-network flooding backups.
There’s nothing like a bunch of green ticks to let you know that your VM’s are backed up safely
- 23/03/2010 – Added custom PowerShell Script and how to set this up on the cluster. Serialized backups don’t work with just the registry entry.
- 03/04/2010 – Fixed up error in the PowerShell Set-ExecutionPolicy command (thanks Hans)