Friday, October 02, 2009

Backup VM on Hyper-V Cluster

First: Backup Exec 12.5 agent for Hyper-V does not work for the cluster configuration! So, you will spend $1000 for nothing.
Here how you can backup VMs with Microsoft Windows Backup. I did configure it for Windows 2008 sp2 Hyper-V cluster.
  1. Enable Windows backup on each cluster node.
  2. Create a batch what will include backup of all VMs and Quorum in the cluster.
  3. Using Windows Scheduler run the batch (with high privileges).
The script example:

echo off

wbadmin start backup -backupTarget:\\hvbackup\hvvms\dc01 -include:N: -vssFull -noVerify -quiet

if %errorlevel% equ -2 echo skipped dc01

if %errorlevel% equ -2 goto quorum

:quorum

wbadmin start backup -backupTarget:\\hvbackup\hvvms\quorum -include:Q: -vssFull -noVerify -quiet

if %errorlevel% equ -2 echo skipped quorum

if %errorlevel% equ -2 goto ts02

:ts02

wbadmin start backup -backupTarget:\\hvbackup\hvvms\ts02 -include:S: -vssFull -noVerify -quiet

if %errorlevel% equ -2 echo skipped ts02

if %errorlevel% equ -2 goto util01

:util01

wbadmin start backup -backupTarget:\\hvbackup\hvvms\util01 -include:P: -vssFull -noVerify -quiet

if %errorlevel% equ -2 echo skipped util01

if %errorlevel% equ -2 goto util02

:util02

wbadmin start backup -backupTarget:\\hvbackup\hvvms\util02 -include:O: -vssFull -noVerify -quiet

if %errorlevel% equ -2 echo skipped util02

exit

The script you will need to run on each node and it will skip VM currently on other node. In my configuration I have separate LUN for each VM it is not R2 yet.
Do not forget to apply Microsoft fix on each Hyper-V host: http://support.microsoft.com/kb/958662

2 comments:

  1. What about checking successfully completed the job?

    ReplyDelete
  2. you can create log files.

    ReplyDelete