Template Scripts for Generic Enabler Implementation with Hitachi HDS



================= Typical Hitachi ShadowImage Snap Script for RD Generic Enabler ==================

@ECHO OFF

REM This is an example script
REM It will be used by Generic Enabler of Recovery Director to manage snapshot for Hitachi 9900V system.

REM -- Required Vars
set HORCC_MRCF=1
set HORCMINST=0
set sivg=remote
set remotehost=saniican2.devemc.company.com
set localhost=saniican4.devemc.company.com
set shortlocalhost=saniican4
set HitachiBaseDir=c:\horcm\etc
set GalaxyBaseDir=<software installation path>\Base
set ScriptDir=c:\GEScripts
set RemoteScriptDir=c:\GEScripts
set CV_ERRORLEVEL=0

REM -- Optional Vars
set timeout=300


REM Check for certain key binaries before running.
IF NOT EXIST "%GalaxyBaseDir%\remex.exe" GOTO MissingFile

REM *************************************************************************************************

REM unmount remote drives
"%GalaxyBaseDir%\remex.exe" -s %remotehost% -c "%RemoteScriptDir%\GEHDSumount.bat" -vm <InstanceName*> -cn <ClientName>
if not errorlevel 0 goto Abort


REM Verify that the status of the primary volumes are SMPL
"%HitachiBaseDir%\pairevtwait.exe" -g %sivg% -s smpl -t %timeout%
if not errorlevel 0 goto Abort


REM Create pairs and do initial copy operation
"%HitachiBaseDir%\paircreate.exe" -g %sivg% -vl -c 15
if not errorlevel 0 goto Abort


REM wait until S-VOL is in PAIR status
:rescan
sleep 5
"%HitachiBaseDir%\pairvolchk.exe" -g %sivg% -c -ss
if not errorlevel 33 goto rescan

REM -- Use CVSnapTool to quiesce the applications if they exist
REM "%GalaxyBaseDir%\cvsnaptool.exe" -x saniican4 -a ex2000 -g SG1 -o quiesce -vm <InstanceName*> -cn <ClientName>
REM if not errorlevel 0 goto Abort
REM "%GalaxyBaseDir%\cvsnaptool.exe" -x saniican4 -a sql2000 -v G: -o quiesce -vm <InstanceName*> -cn <ClientName>
REM if not errorlevel 0 goto Abort


REM split pairs
"%HitachiBaseDir%\pairsplit.exe" -g %sivg% -S
if not errorlevel 0 goto Abort


REM -- Use CVSnapTool to unquiesce the applications if they exist
REM "%GalaxyBaseDir%\cvsnaptool.exe" -x saniican4 -a ex2000 -g SG1 -o unquiesce -vm <InstanceName*> -cn <ClientName>
REM if not errorlevel 0 goto Abort
REM "%GalaxyBaseDir%\cvsnaptool.exe" -x saniican4 -a sql2000 -v G: -o unquiesce -vm <InstanceName*> -cn <ClientName>
REM if not errorlevel 0 goto Abort

REM mount remote drives
"%GalaxyBaseDir%\remex.exe" -s %remotehost% -c "%RemoteScriptDir%\GEHDSmount.bat" -vm <InstanceName*> -cn <ClientName>
if not errorlevel 0 goto Abort


REM Execute gesnap.exe to populate the CS database
"%GalaxyBaseDir%\gesnap.exe" update create -src F: -dest E: -desthost %remotehost% -mp E: -uniqueid 10000 -vm <InstanceName*> -cn <ClientName>
if not errorlevel 0 goto Abort
"%GalaxyBaseDir%\gesnap.exe" update create -src G: -dest F: -desthost %remotehost% -mp F: -uniqueid 10001 -vm <InstanceName*> -cn <ClientName>
if not errorlevel 0 goto Abort

REM *************************************************************************************************

REM Exit clean
set CV_ERRORLEVEL=0
goto Exit

:MissingFile
net send %shortlocalhost% "Missing file %GalaxyBaseDir%\remex.exe"
goto Abort

:Abort
echo An error occurred during batch file execution.
set CV_ERRORLEVEL=1
goto Exit

:Exit
@echo off
@echo ERRORLEVEL=%ERRORLEVEL%
@echo CV_ERRORLEVEL=%CV_ERRORLEVEL%

==========================================================================================


================= Typical Hitachi ShadowImage Unsnap Script for RD Generic Enabler ==================
@ECHO OFF

REM The following script unmounts and destroys pairs.
cd c:\horcm\etc
set HORCC_MRCF=1
set HORCMINST=0

REM -- Required Vars
set HORCC_MRCF=1
set sivg=remote
set remotehost=saniican2.devemc.company.com
set localhost=saniican4.devemc.company.com
set HitachiBaseDir=c:\horcm\etc
set GalaxyBaseDir=<software installation path>\Base
set ScriptDir=c:\GEScripts
set RemoteScriptDir=c:\GEScripts

REM Check for certain key binaries before running.
IF NOT EXIST "%GalaxyBaseDir%\remex.exe" GOTO MissingFile

"%GalaxyBaseDir%\remex.exe" -s %remotehost% -c "%RemoteScriptDir%\GEHDSumount.bat" -vm <InstanceName*> -cn <ClientName>
if not errorlevel 0 goto Abort


REM The ShadowImage pair will be deleted by the end of the Workflow.
"%HitachiBaseDir%\pairsplit.exe" -g %sivg% -S
if not errorlevel 0 goto Abort


REM Exit clean
set CV_ERRORLEVEL=0
goto Exit

:MissingFile
net send %shortlocalhost% "Missing file %GalaxyBaseDir%\remex.exe"
goto Abort

:Abort
echo An error occurred during batch file execution.
set CV_ERRORLEVEL=1
goto Exit

:Exit
@echo off
@echo ERRORLEVEL=%ERRORLEVEL%
@echo CV_ERRORLEVEL=%CV_ERRORLEVEL%

==========================================================================================


================= Typical Hitachi ShadowImage CopyBack Script for RD Generic Enabler ================

@ECHO OFF

REM This is an example script
REM It will be used by Generic Enabler of Recovery Director to manage hardware level restore for Hitachi 9900V system.
REM This script can be launched as the Recovery Script so that much faster LAN free recovery can be completed

REM -- Required Vars
set HORCC_MRCF=1
set HORCMINST=0
set sivg=remote
set remotehost=saniican2.devemc.company.com
set localhost=saniican4.devemc.company.com
set shortlocalhost=saniican4
set HitachiBaseDir=c:\horcm\etc
set GalaxyBaseDir=<software installation path>\Base
set ScriptDir=c:\GEScripts
set RemoteScriptDir=c:\GEScripts
set CV_ERRORLEVEL=0

REM -- Optional Vars
set timeout=300

REM unmount source volumes
"%HitachiBaseDir%\pairsplit.exe" -x umount F:
"%HitachiBaseDir%\pairsplit.exe" -x umount G:
if not errorlevel 0 goto Abort


REM Verify that the status of the primary volumes are SMPL
"%HitachiBaseDir%\pairevtwait.exe" -g %sivg% -s smpl -t %timeout%
if not errorlevel 0 goto Abort


REM Create pairs and do REVERSE copy operation
"%HitachiBaseDir%\paircreate.exe" -g %sivg% -vr -c 15
if not errorlevel 0 goto Abort


REM wait until S-VOL is in PAIR status
:rescan
sleep 5
"%HitachiBaseDir%\pairvolchk.exe" -g %sivg% -c -ss
if not errorlevel 23 goto rescan

REM -- Use CVSnapTool to quiesce here
REM "%GalaxyBaseDir%\cvsnaptool.exe" -x saniican4 -a ex2000 -g SG1 -o quiesce -vm <InstanceName*> -cn <ClientName>
REM if not errorlevel 0 goto Abort
REM "%GalaxyBaseDir%\cvsnaptool.exe" -x saniican4 -a sql2000 -v G: -o quiesce -vm <InstanceName*> -cn <ClientName>
REM if not errorlevel 0 goto Abort

REM split pairs
"%HitachiBaseDir%\pairsplit.exe" -g %sivg% -S
if not errorlevel 0 goto Abort


REM -- Use CVSnapTool to unquiesce here
REM "%GalaxyBaseDir%\cvsnaptool.exe" -x saniican4 -a ex2000 -g SG1 -o unquiesce -vm <InstanceName*> -cn <ClientName>
REM if not errorlevel 0 goto Abort
REM "%GalaxyBaseDir%\cvsnaptool.exe" -x saniican4 -a sql2000 -v G: -o unquiesce -vm <InstanceName*> -cn <ClientName>
REM if not errorlevel 0 goto Abort

REM mount source volumes
"%HitachiBaseDir%\pairsplit.exe" -x mount F: HarddiskVolume12
"%HitachiBaseDir%\pairsplit.exe" -x mount G: HarddiskVolume13
if not errorlevel 0 goto Abort


REM Exit clean
set CV_ERRORLEVEL=0
goto Exit

:Abort
echo An error occurred during batch file execution.
set CV_ERRORLEVEL=1
goto Exit

:Exit
@echo off
@echo ERRORLEVEL=%ERRORLEVEL%
@echo CV_ERRORLEVEL=%CV_ERRORLEVEL%

==========================================================================================


================ Typical Hitachi ShadowImage Quick Recovery Script for RD Generic Enabler =============

@ECHO OFF

REM Set HDS environment
REM cd c:\horcm\etc
set HORCC_MRCF=1
set HORCMINST=1

REM -- Required Vars
set HORCC_MRCF=1
set sivg=local
set localhost=saniican4.devemc.company.com
set shortlocalhost=saniican4
set HitachiBaseDir=c:\horcm\etc
set GalaxyBaseDir=<software installation path>\Base
set ScriptDir=c:\GEScripts


REM The ShadowImage pair will be deleted by the recovery process.
"%HitachiBaseDir%\pairsplit.exe" -g %sivg% -S
if not errorlevel 0 goto Abort

REM The following script unmount the source volumes and BCVs.

"%HitachiBaseDir%\pairsplit.exe" -x umount P:
if not errorlevel 0 goto Abort
"%HitachiBaseDir%\pairsplit.exe" -x umount Q:
if not errorlevel 0 goto Abort
"%HitachiBaseDir%\pairsplit.exe" -x umount U:
if not errorlevel 0 goto Abort
"%HitachiBaseDir%\pairsplit.exe" -x umount V:
if not errorlevel 0 goto Abort

REM The following script mount the BCVs using drive letters of source volumes.

"%HitachiBaseDir%\pairsplit.exe" -x mount P: HarddiskVolume16
if not errorlevel 0 goto Abort
"%HitachiBaseDir%\pairsplit.exe" -x mount Q: HarddiskVolume17
if not errorlevel 0 goto Abort


:Exit_Clean
REM Exit clean
set CV_ERRORLEVEL=0
goto Exit

:Abort
echo An error occurred during batch file execution.
set CV_ERRORLEVEL=1
goto Exit

:Exit
@echo off
@echo ERRORLEVEL=%ERRORLEVEL%
@echo CV_ERRORLEVEL=%CV_ERRORLEVEL%
=================================================================================

============== Typical Hitachi ShadowImage Mount Script for RD Generic Enabler =============
REM Set the ShadowImage environment
REM cd c:\horcm\etc
set HORCC_MRCF=1
set HORCMINST=0
set HitachiBaseDir=c:\horcm\etc

REM Mount the SVOLs to the remote machine
"%HitachiBaseDir%\pairsplit.exe" -x mount E: HarddiskVolume1
"%HitachiBaseDir%\pairsplit.exe" -x mount F: HarddiskVolume2
==================================================================================


============== Typical Hitachi ShadowImage Unmount Script for RD Generic Enabler =============
REM Set the ShadowImage environment
REM cd c:\horcm\etc
set HORCC_MRCF=1
set HORCMINST=0
set HitachiBaseDir=c:\horcm\etc

REM Unmount the SVOLs from the remote machine
"%HitachiBaseDir%\pairsplit.exe" -x umount E:
"%HitachiBaseDir%\pairsplit.exe" -x umount F:
==================================================================================

* InstanceName is the name used for a Recovery Director instance (by default it is Instance001).