An easy way to backup your Hyper-v vhd file with Powershell!
Posted in Virtual Machine Manager, Windows Powershell | 1 Comment | 7,396 views | 29/03/2009 23:27
You don’t need to use Data Protection Manager to backup your vhd files. You can use Windows Backup (with a little hack) or my method. It’s not a good method maybe, but it is easy to use and free. Just you need SCVMM Library to use this ps1 file. Now let’s see my codes:
As you can see, it’s really simple. First, I do “savestate-vm” then find vhd location and copy it to vmm library and finally do “start-vm”. $VMMPath is your SCVMM Library Path. That is just an example. Also you can add date to your vhd files name like win2008-01052009.vhd. But if you want to do that, you should use -replace for a second time. If you want to use this script, you just need to type “backup.ps1 VDS02”. Backup ps1 will save VDS02 and after backing up, will start it again.
You can add a cronjab for this script. It’s a good solution. You may need to change backup.ps1 file to backup all vm’s at the same time.
Tags: backup hyper-v with powershell, powershell vhd backup, scvmm .vhd powershell backup, scvmm backup powershell
Leave a Reply