ProxyHost with CVSnaptool - Truncating Exchange Logs
Overview
Batch Files for Exchange Log
Truncation
Configuring ProxyHost
for Exchange Log Truncation
Considerations
The following section provides instructions for using CVSnaptool with a hardware
snap engine and the ProxyHost iDataAgent
to quiesce, unquiesce, and to eventually truncate the Exchange transaction logs.
This is effected by first marking the last consistent log during the quiesce and
saving that information to an ini file, which is
referenced later to truncate the committed Exchange transaction logs from the quiesce
time.
A standard ProxyHost backup typically uses two batch files that perform the following
functions:
- PreScan batch file
- CVSnaptool quiesce
- HW snap creation
- CVSnaptool unquiesce
- HW snap import
- PostBackup batch file
With Exchange log truncation added, the batch file adds the Exchange Log truncation
functionality:
- PreScan batch file
- CVSnaptool quiesce and mark last consistent log in
ini file
- HW snap creation
- CVSnaptool unquiesce
- HW snap import
- PostBackup batch file
- HW snap cleanup
- CVSnaptool Exchange log truncation based on
ini file
@REM Vars (var for ini file is mandatory, call it whatever
you want)
SET CV_INI_FILE_NAME=%windir%\temp\Truncate.ini
SET
GalaxyBaseDir=<install_direcory>\Base
@REM Cleanup preexisting ini file first (NEW - a safety
measure to guarantee no leftover exchange info).
DEL %CV_INI_FILE_NAME%
@REM Quiesce section (Changes).
"%GalaxyBaseDir%"\Cvsnaptool.exe -x <client_name>
-a ex2003 -g SG2 -o quiesce -markexchlogs -ini %CV_INI_FILE_NAME% -vm <InstanceName*> -cn <ClientName>
@REM Snap section (no change)
<HW snap creation cmd>
@REM Unquiesce section (no change)
"%GalaxyBaseDir%"\Cvsnaptool.exe -x <client_name>
-a ex2003 -g SG2 -o unquiesce -vm <InstanceName*> -cn <ClientName>
@REM Import section (no change)
<HW snap import cmd>
@REM Vars (changes)
IF '%6'=='1' GOTO BACKUP_SUCCESSFUL
net send <client_name> backup phase did not complete
successfully, so I won't execute the log truncation
exit 1
:BACKUP_SUCCESSFUL
SET CV_INI_FILE_NAME=%windir%\temp\Truncate.ini SET
GalaxyBaseDir=<install_direcory>\Base
@REM Destroy snap
net send <client_name> snap destroyed
@REM Truncate section (NEW).
"%GalaxyBaseDir%"\Cvsnaptool.exe -o truncateexchlogs
-ini %CV_INI_FILE_NAME% -vm <InstanceName*> -cn <ClientName>
* InstanceName is the name used for a Proxy Host instance (by default it is Instance001).
If multiple
instances of Proxy Host are installed use the corresponding instance name, see
Multi Instancing for more information.
Required Capability:
Capabilities
and Permitted Actions
To configure
ProxyHost to truncate Exchange Logs:
- Create the PreScan and PostBackup batch files, using the example scripts
above. These files must reside on the backup host or primary host.
- Install the ProxyHost iDataAgent
on the production server, and the Windows File System
iDataAgent on both the production server
and backup host. Refer to Deployment
- ProxyHost iDataAgent and
Deployment - Windows File System
iDataAgent.
- Configure a supported
Snapshots Environment.
- Create a New Subclient,
and configure subclient
content. Click the
Pre/Post Process
tab of the Subclient Properties dialog box. In the PreScan field, type
the path to the batch file file that contains those commands that are to run
before each backup of the subclient, or click Browse to locate and select
the batch file. Do the same for the PostBackup field.
- Perform a backup. For more information, see Backup
- ProxyHost.
Additional Suggestions:
- View the CVSnaptool log file during the quiesce
–markexchlogs command to see what is marked as the 'last consistent log'.
Everything up to, but not including, that log will be truncated on that Exchange
storage group.
- Open the ini file after the quiesce command
has run to verify it contains accurate information on the Exchange storage group
you are quiescing, including the log prefix and last consistent log.
- View the CVSnaptool log file again during the truncateexchlogs
command to see which logs will be deleted, and on which Exchange storage groups.
- The ini file must have same path and name
in all scripts that reference it, although the variable name can be different.
- On a cluster, the ini file must be on a
shared disk resource, so that in the event of a failover, the file can still
be accessed by the script.
- The cvsnaptool –truncate command is sensitive;
certain normal cvsnaptool arguments are not necessary and may cause the Exchange
log truncation to fail. A server name (–x) is
not required, as it is stored in the ini file,
nor is app name (–a) since Exchange is assumed.
- If you omit the –g switch from the CVSnaptool
quiesce command, it will quiesce all of the
storage groups on your server. If you omit the –g
switch from the cvsnaptool truncate command,
it will truncate all of the storage groups on your server. You can use
–g to truncate a specific storage group, but
if you originally used –g in the quiesce/mark,
then only that storage group will actually be listed in the
ini file so it is not necessary. However, if
you quiesced all storage groups originally, you can use
–g in the truncate
command to only truncate one of them.
- For a storage group with spaces in the name, e.g.,
FIRST STORAGE GROUP, use double quotes around
the name when using the –g switch.
- When using multiple ProxyHost subclients for your Exchange storage groups,
the ini files for each group must have unique
names; using the same ini file name for multiple
subclients creates a risk of them getting overwritten or populated with the
wrong info.
- While a single storage group can be quiesced with the
–g switch, and all storage groups can be quiesced
by omitting the –g switch, there is no way to
specify only some storage groups, for instance only two out of three. To accomplish
this, repeat the quiesce command with the –g
switch for each storage group, but remember to use a different
ini file for each of these commands; otherwise,
the latter storage group data will overwrite the data from the previous storage
group.
- PostBackup scripts are executed without regard to the success or failure
of the backup attempt itself. However, the PostBackup script contains the log
truncation step and it is very important that log truncation be executed only
after a successful backup. This is ensured by utilizing a status variable, passed
by the Job Manager to the PostBackup phase, in the 'if' statement in the example
script to determine whether log truncation should run or not.