Home > Storage > PowerMax and VMAX > Storage Admin > Implementing Dell SRDF SRA with VMware SRM > Windows
The following example uses a Window SRM server. To add the script to the Recovery Plan, right-click on the first step “Pre-synchronize storage” and “Add Step Before” as in Figure 90.
Figure 90. Add custom script to Recovery Plan
In the dialog box that appears, leave the default on “Command on SRM Server”. In the Content box add a script to run the SnapVX command. In the example in Figure 91, a batch file is executed on the Windows SRM server which is also the Array Manager. The script runs a simple symsnapvx command, first removing the existing snapshot and then adding another:
symsnapvx -f gold.txt -snapshot_name gold_copy terminate -sid 358 -nop
symsnapvx -f gold.txt -name gold_copy establish -sid 358 -nop
Figure 91. Windows SRM Command script in recovery plan
After the step is added, it will appear in the Recovery Plan in Figure 92.
Figure 92. Recovery Plan with Command script
A successful test failover run shown in Figure 93, will generate two snapshots, one for the gold copy, and the other the SRA creates for the test.
Figure 93. Test failover run with gold copy script
Now each time a test failover or actual failover is run, the existing snapshot is deleted and a new, targetless gold copy is created.
As Solutions Enabler cannot be installed on the SRM Appliance, injecting the previous script is more complicated because VMware executes the script as the “srm” user which has no login account and thus no shell. VMware does allow executing perl, python, and bash, so savvy users may be able to utilize these to execute the desired commands, but it is not as straightforward as Windows.
A good way to execute the deletion and creation is via the REST API available in Unisphere for PowerMax. These commands could be sent through curl or python. The following shell script below in Figure 94 executes a python script that removes the existing snapshots and creates new ones for the configured storage group.
The gold.sh script executes a python script.
#!/bin/bash
/usr/bin/python3 /home/admin/snap.py
Figure 94. SRM Appliance script in recovery plan
This gold.sh script assumes that PyU4V is installed. It can be found here: https://github.com/dell/PyU4V. This script in Figure 95 is very basic and does not include any error handling. It assumes that there is at least one snapshot called "gold_copy" before running, otherwise the script will fail. It does exactly what the gold_copy.bat for SRM Windows does.
Figure 95. Snap.py script
SRDF SRA version 10.0.1 introduces support for targetless gold copies. To enable the functionality, a new parameter is available in the EmcSrdfSraGlobalOptions.xml file:
<FailoverWithTargetlessGoldCopy>No</FailoverWithTar getlessGoldCopy>
The default value for this is “No” or disabled. When enabled, the SRDF SRA will create a targetless snapshot (SnapVX) on both the R1 and R2 devices prior to actual failover. The SRA creates the R1 snapshots immediately, while it creates the R2 snapshots just before the failover command.
If the user desires to create a snapshot on only the R1 or R2, the user must modify the EmcSrdfSraProtectionSiteGoldcopyConfig.xml or EmcSrdfSraRecoverySiteGoldcopyConfig.xml file to include either the R1 or R2 source. The target field would remain empty. The modification of these files is covered in the next sections.
The following points hold true for the parameter:
Note: Creation of snapshots on the protection site are dependent on its availability. During an actual failover if the protection site is down, and FailoverIfGoldCopyFails is set to “Yes” (default), the SRA will ignore the errors.