APPLIES TO
KB958662: How to back up Hyper-V virtual machines from the parent partition on a Windows Server 2008-based computer by using Windows Server Backup lists the procedures, and includes a FixIt script, can you help expand this article with additional information, screenshots, demonstrations?
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. You can use the FixIt on the KB page to register the the Microsoft Hyper-V VSS writer with Windows Server Backup for you.
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756 (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows.
NOTE:
The steps in this article are for all VMs on the host. To back up only specificed VMs on the host use your enterprise backup software of choice.
Check whether the problem is fixed. If the problem is fixed, you are finished with this article. If the problem is not fixed, you can contact support (http://support.microsoft.com/contactus) .
Note: Windows Server Backup does not support backing up Hyper-V virtual machines on Cluster Shared Volumes (CSV volumes).
To restore the virtual machines, follow these steps:
Note All volumes that host files for the virtual machine will be restored. Individual virtual machines cannot be restored by using Windows Server Backup. Virtual machines that contain two or more snapshots will not be restored. To work around this issue, follow these steps:
You should test that your backups are good. Tore Lervik gives a PowerShell script to monitor your backups on his blog. His script below checks the last successfull backup, and script sends email if the last successfull backup is older a designated time period (24 hours by default). It will also send a "backup succeded" mail.
$maxHours = 24 $email = "your@mail.net" $smtpServer = "stmp.mail.net" $sendSuccess = $true ## Script ------------------------------------------------------------ Add-Pssnapin Windows.serverbackup $summary = Get-WBSummary $timeBetween = [DateTime]::Now - $summary.LastSuccessfulBackupTime $computerName = get-content env:computername if ($summary -eq $null) { $smtp = new-object Net.Mail.SmtpClient($smtpServer) $smtp.Send($email, $email, "BackupCheck.ps1 failed on $computerName", "BackupCheck.ps1 failed with unknown error.") } elseif ($timeBetween.TotalHours -gt $maxHours) { $smtp = new-object Net.Mail.SmtpClient($smtpServer) $smtp.Send($email, $email, "Windows Server Backup on $computerName failed", "Last successfull backup on $computerName was at " + $summary.LastSuccessfulBackupTime) } elseif ($sendSuccess) { $smtp = new-object Net.Mail.SmtpClient($smtpServer) $smtp.Send($email, $email, "Windows Server Backup on $computerName was successfull", "Last backup on $computerName was successfull at " + $summary.LastSuccessfulBackupTime) }
Blog: DPM for data backup/recovery of virtualized apps and environments
TN Library: Protecting Hyper-V with DPM 2007 SP1
Tony Soper_MSFT edited Revision 1. Comment: Can someone help format the code correctly, then educate us all on the best way to do this on the wiki?
Sean Jenkin MSFT edited Revision 2. Comment: Updating the code to use some formatting options
Sean Jenkin MSFT edited Revision 4. Comment: Rolling back the quote change
Tony Soper_MSFT edited Revision 5. Comment: Code formatted using http://tohtml.com/
Tony Soper_MSFT edited Revision 11. Comment: added NOTE:
Tony Soper_MSFT edited Revision 12. Comment: Moved NOTE to top
Ed Price MSFT edited Revision 16. Comment: Updated title case.
FZB edited Revision 20. Comment: typos
Thanks a million Tony/ED: invaluable article. It's very difficult though, editing the registry & writing scripts. I have direct experience of a product called www.hyperoo.net that does all this & more, including delta transfers & scheduling, in a friendly interface. You get a free trial & it's cheap to buy. I'd be very interested to hear what you guys think of it?
Thanks,
Gavin.