Integrating HP Data Protector 6.1 with SAN Virtualization Services Platform

17
Appendix A
Currently we use 4 scripts, 2 pre-exec and 2 post-exec. In each execution phase (pre- and post-
execution), one file is the .bat file executed by Data Protector and the other serves as a template
for the actual SVSP script executed by the .bat file. Both .bat files need to be modified to suit the
actual environment, i.e. at least all the variables values enclosed in “<…>”. Note that the ‘<’ and
‘>’ signs must be removed as well. These files must be copied as stated in the section
Copying and editing the scripts.
Sample Pre-exec Scripts
Filename: svsp_pre_exec.bat
Contents:
:: Prepare both pre & post exec scripts with variable names
cd "<C:\Program Files\OmniBack\bin>"
copy pre_exec.txt pre_exec_%SESSIONID:/=-%.txt
copy post_exec.txt post_exec_%SESSIONID:/=-%.txt
perl -pi.bak -e "s/_BACKUPHOST_/<backupHost>/g" pre_exec_%SESSIONID:/=-%.txt
perl -pi.bak -e "s/_STORAGEPOOL1_/<my_pool>/g" pre_exec_%SESSIONID:/=-%.txt
perl -pi.bak -e "s/_VIRTUALDISK1_/<vdisk1>/g" pre_exec_%SESSIONID:/=-%.txt
perl -pi.bak -e "s/_MOUNTPOINT1_/<mountPoint1>/g" pre_exec_%SESSIONID:/=-%.txt
perl -pi.bak -e "s/_POINTINTIME1_/pit1_%SESSIONID:/=-%/g"^
pre_exec_%SESSIONID:/=-%.txt
perl -pi.bak -e "s/_POINTINTIME1_/pit1_%SESSIONID:/=-%/g"^
post_exec_%SESSIONID:/=-%.txt
perl -pi.bak -e "s/_SNAPSHOT1_/snap1_%SESSIONID:/=-%/g"^
pre_exec_%SESSIONID:/=-%.txt
perl -pi.bak -e "s/_SNAPSHOT1_/snap1_%SESSIONID:/=-%/g"^
post_exec_%SESSIONID:/=-%.txt
vsm_cli -sd <domain> <username> <password> -I pre_exec_%SESSIONID:/=-%.txt
Filename: pre_exec.txt
Contents:
# start actual work
OnErrorGoto ExitScript
# --- Quiesce application (if applicable)
# --- Flush OS cache - on App Server! (Win2003 only)
# --- FlushCache -VirtualDisk "_VIRTUALDISK1_"
OnErrorGoto CleanPiT
CreatePiT -VirtualDisk "_VIRTUALDISK1_", ~
-PiT "_POINTINTIME1_", -TIMEOUT 900
# --- Resume application (if applicable)
OnErrorGoto CleanAll
CreateSnapshot -PiT "_POINTINTIME1_", -snapshot "_SNAPSHOT1_", ~
-StoragePool "_STORAGEPOOL1_", -host "_BACKUPHOST_" RW , ~
-cluster 0, -TIMEOUT 900
RescanDevices
MountVirtualDisk -MountPoint "_MOUNTPOINT1_", -VirtualDisk "_SNAPSHOT1_", ~
-Override
Goto ExitScript
CleanAll:
AllowExecErrors
UnmountVirtualDisk -VirtualDisk "_SNAPSHOT1_"
DeletePiTOrSnapshot -name "_SNAPSHOT1_", -TIMEOUT 900
DeletePiTOrSnapshot -name "_POINTINTIME1_", -TIMEOUT 10800
DisallowExecErrors
Goto ExitScript