VCB – Backup all running VMs
As student on my course last week gave me a little one line batch file that will backup every running VM on VC. This is it here:
for /f “tokens=2 delims=:” %%i in (‘vcbvmname -h virtualcenter.rtfm-ed.co.uk -u administrator -p password -s Powerstate:on ^| find “name:”‘) do @rd /s /q “D:\Backups\All\%%i” &vcbmounter -h virtualcenter.rtfm-ed.co.uk -u administrator -p password -a name:”%%i” -r “D:\Backups\All\%%i” -t fullvm > “D:\Backups\All\%%i.log”
This use the vcbvmname command to search for just the VMs that currently powered on. It then pipes that information to the vcbMounter command to start a FullVM style backup. The progress of each backup is recorded in the LOG files for each VM.
Pretty neat for a 1-line batch file, huh. Many thanks to Andrew Neilson who works for Ericsson Services here in the UK.





RSS
iTunes
January 30th, 2008 at 8:17 pm
[...] Today I was busy trying to find out a way to schedule VCB backups with Commvault with just 1 schedule without having to rewrite your script every time someone creates a VM. The standard procedure is to create a subclient for every VM which is very human error prone. I stumbled upon a blog on RTFM about backing up all running VM’s, the actual script was done by Andrew Neilson, thanks! Of which the following was the most important part: for /f “tokens=2 delims=:†%%i in (’vcbvmname -h virtualcenter.rtfm-ed.co.uk -u administrator -p password -s Powerstate:on ^| find “name:â€â€˜) do @rd /s /q “D:BackupsAll%%i†&vcbmounter -h virtualcenter.rtfm-ed.co.uk -u administrator -p password -a name:â€%%i†-r “D:BackupsAll%%i†-t fullvm > “D:BackupsAll%%i.log [...]