Wednesday, September 23, 2009

Automating VCB using Script

Recently we migrated the Virtual Machines from FAS 3050 to 3070. All our our data and LUN's are assigned from FAS3050 . So before migrating data from one filer to other filer we took the Virtual Machine Back up using the below script.

1. Save the below script as a VCB.cmd
@echo off
set filename=%1%
set clustername=%2%

FOR /F "delims=|" %%I IN (%filename%) DO start "%%I" vcbs.cmd "%%I" "%clustername%"
2. Save the below script as a vcbs.cmd
@echo off
set vcbExePath=C:\Program Files\VMware\VMware Consolidated Backup Framework
set VCaddress=Virtual Center IP address
set ADuser=Login Name to the Virtual Center
set ADpassword=password
set VMname=%~1
set Clustername=%~2
set BackupPath=path for the backup

"%vcbExePath%\vcbMounter" -h %VCaddress% -u %ADuser% -p %ADpassword% -a name:"%VMname%" -r "%BackupPath%%VMname%" -t fullvm -m san
3. Save list of servers on text file eg: serverlist.txt
4.Run the below command on VCB server from Run->cmd.
vcb.cmd serverlist.txt Groupname
Groupname is use simply for grouping backups in one directory

No comments:

Post a Comment