What is a good backup plan for Hyper-V Virtual Images?

One thing you can do if you want to use robocopy with volume shadow copies is use the VShadow tool from MS (http://msdn.microsoft.com/en-us/library/bb530725.aspx)

I've outlined a brief approach below, you'd want to create a batch script to automate this process but it isn't too difficult.

You can create a shadow copy using the vshadow tool. Following this, using the -el flag (with vshadow again) you can expose the shadow copy under a drive letter (like x:). Following this you can use robocopy to create backups from the mounted shadow copy drive.

I've outlined a rough script below, note this hasn't been tested. It takes a shadow copy of C: and mounts it as X:

setlocal
IF NOT "%CALLBACK%" == "" GOTO :VS_CALLBACK 

set CALLBACK=%~dpnx0
vshadow.exe -p -script=TempScript.cmd -exec=%CALLBACK% C: 

:VS_CALLBACK  
setlocal
call TempScript.cmd
vshadow.exe -el=%SHADOW_ID_1%,X:

del /f TempScript.cmd

robocopy X:\ \\backup\server

Obviously the robocopy command needs to be customised to suit whatever you're doing (copy VHD's from some location etc). Hopefully this is helpful!


Check out this question: Best method(s) to backup VMs running on HyperV?