Posted by
Matthew Hodgkins in
DPM
Mar 10th, 2010 |
12 responses
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
UPDATES:
- 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)
Hi Matthew,
Thanks for your explanation. While executing your steps I noticed that the Set-ExecutionPolicy Remote-Signed didn’t work.
The command that works is: Set-ExecutionPolicy -executionPolicy RemoteSigned
Regards,
Hans
Thanks for the correct command Hans, have updated it in my post. Glad you enjoyed the post.
I’m a reader of your blog too
http://hyper-v.nu/blogs/hans/
Thank you. This is great. I made 3 updates to the script, I can send it to you if you would like.
1) Make it remotable to run anywhere instead of cluster node.
2) Allow multiple clusters.
3) Remove assumption that Volume name begins with Volume.
Great you liked the post Joe.
That would be wonderful! I’d be happy to update it on the post.
I will email you about it.
Is this powershell script ListVMon ClusterforDPM what I need for the following problem that i have with DPM2010:
I have installed Protection agent on a Hyper V server 2008-R2 and i automatically see the VM (child snapshot) on the Hyper-V in DPM2010 if i want to backup the VM using DPM2010. And i can take a backup of the Hyper-V volumes and of the child VM. So far, so good.
I have installed Protection agent on 1 of the Hyper-V servers forming together a cluster. I can backup the Hyper-V volumes with DPM2010 but i don’t see in DPM2020 my VMs on that Hyper V server. And so i cannot select it to back it up. And i don’t know why.
Do all the Hyper-V servers in the cluster need the Protection agent ? Or do i have to configure in DPM something special to see the VM because it is a cluster as the powershell script above. if so, isn’t there a more elegant way ?
Rgds,
@ Johnas
1. Yes – you need to install the DPM agent on each node of the Hyper-V Cluster
2. The script only needs to be on a single node of the cluster
Matt
Hi,
Is the MaxAllowedParallelBackups a per node or per cluster setting?
I have a 5 node cluster with 70 vm’s and I would like to run 5 parallel backups, one per node.
Thanks
@John – The MaxAllowedParallelBackups registry key is per node. In this case you would need to set it to 1 which is 1 backup * 5 nodes. This will give you the required 5 parallel backups.
Matt
Hi Matt,
great Job thx for this great Article. Was very useful and worked like a charm.
Best Regards
Philipp from Germany
@Philipp – Glad it helped you out
[...] With respect to parallel backups of Hyper-V Virtual Machines with DPM 2010 I refer to a very helpful blog by Matthew Hodgkins: Enabling Serialized Hyper-V Virtual Machine Backups in DPM 2010 RC [...]
[...] backup VM’s simultaneously. If you cannot use a VSS hardware provider, you must run a script that serializes the backup of your VM’s and change the MaxAllowedParallel Backups registry key to tell the backup [...]