Implementing a Metro Mirror and Global Mirror topology
This chapter describes the creation of a Multiple Target Peer-to-Peer Remote Copy (PPRC) topology with Metro Mirror and Global Mirror. It includes the following topics:
41.1 Overview of a Metro Mirror and Global Mirror topology
A topology with Metro Mirror and Global Mirror provides both a local high availability capability and, at the same time, a long-distance disaster recovery capability. In such a configuration, data is synchronously mirrored to one secondary site and is asynchronously mirrored to a separate disaster recovery site.
Figure 41-1 shows Metro Mirror H1:H2 and Global Mirror H1:H3.
Figure 41-1 Metro Mirror and Global Mirror
These are the basic steps of creating a Metro Mirror H1:H2 and Global Mirror H1:H3 topology:
1. Establish all required paths.
2. Establish the H1:H2 Metro Mirror pairs.
3. Establish Global Mirror H1:H3:
a. Establish H1:H3 Global Copy pairs.
b. Create FlashCopy H3:J3.
c. Create and start the Global Mirror session for H1:H3.
The scenarios in this chapter describe recovery actions after an outage at one of the sites. This can be either a failure condition or a planned event for testing or maintenance.
To simplify the descriptions, these sites are often referred to as though they were a single volume, but it must be understood that the terms refer to the entire set of volumes being mirrored by PPRC. For example, “Failover H2:H1” means to fail over all of the H2 volumes to their corresponding H1 volumes.
41.2 Creating a Metro Mirror and Global Mirror topology
This section describes the steps in creating a Multiple Target PPRC configuration with one Metro Mirror and one Global Mirror relationship on each primary volume.
41.2.1 Terms used in examples
For the examples in this section, the following terms are used:
H1 is the current primary site where the production applications are running.
H2 is the Metro Mirror secondary site to which H1 is mirroring data.
H3 is the Global Mirror secondary site to which H1 is mirroring data asynchronously.
Table 41-1 identifies the DS8000 storage controllers used in the examples in this chapter.
 
Note: The volume range on each DS8000 is different in these examples only to help clarify the different sites used. It is not a requirement that they be different.
Table 41-1 Identifications used in DS CLI examples
Site
Role
Dev
WWNN
Volume range
H1
Current primary
IBM.2107-75CZM21
5005076305FFD75A
5000 - 500F
H2
Metro Mirror secondary
IBM.2107-75CYM31
5005076305FFD71E
6000 - 600F
H3
Global Mirror secondary
IBM.2107-75CYK71
5005076305FFD71A
7000 - 700F
J3
Global Mirror FlashCopy targets
IBM.2107-75CYK71
5005076305FFD71A
7200 - 720F
41.2.2 Establish PPRC Paths
PPRC paths are required before the PPRC pairs can be established. It is best to establish all paths that might be needed so that they are available at the time when they are required.
The procedure for establishing these paths is similar to that for the two Metro Mirror topology that is described in 40.2.2, “Establish PPRC paths” on page 453, so it is not repeated here.
41.2.3 Create H1:H2 Metro Mirror pairs
After establishing all of the required PPRC paths, create the Metro Mirror volume pairs H1:H2. These pairs can be initially created as asynchronous Global Copy pairs and later converted to Metro Mirror, or they can be created directly as Metro Mirror pairs. The procedure for establishing the Metro Mirror pairs is the same as that described in 40.2.3, “Create H1:H2 Metro Mirror pairs” on page 454, for the two Metro Mirror topology.
41.2.4 Create H1:H3 Global Copy pairs
Example 41-1 shows a sample DS CLI command to establish the Global Copy pairs.
Example 41-1 Create H1:H3 Global Copy pairs
dscli> mkpprc -dev IBM.2107-75CZM21 -remotedev IBM.2107-75CYK71 -type gcp 5000-500f:7000-700f
CMUC00153I mkpprc: Remote Mirror and Copy volume pair relationship IBM.2107-75CZM21/5000:IBM.2107-75CYK71/7000 successfully created.
...
CMUC00153I mkpprc: Remote Mirror and Copy volume pair relationship IBM.2107-75CZM21/500F:IBM.2107-75CYK71/700F successfully created.
Creation of MTIR pairs
As described in 39.2, “Cascaded PPRC after Multiple Target PPRC failover” on page 443, when the primary DS8000 detects that a Multiple Target PPRC configuration exists, it creates Multi-Target Incremental Resync relationships (MTIR pairs), also known as Multi-Target Internal Relationships, between H2 and H3. These pairs are created regardless of the type of PPRC relationships for H1:H2 and H1:H3.
After establishing the PPRC paths and creating the Metro Mirror and Global Copy pairs, the topology appears as shown in Figure 41-2.
Figure 41-2 Metro Mirror and Global Copy
41.2.5 Create FlashCopy H3:J3
The next step is to establish the FlashCopy relationships from the Global Copy secondary volumes to create the journal volumes used by Global Mirror. These FlashCopy relationships are created with the following attributes:
Inhibit target writes Protects the FlashCopy target volume from being modified by host writes. Only the Global Copy primary can write to the target volume.
Start change recording Starts recording which tracks have changed on either volume in the FlashCopy pair.
Persistent Keeps the FlashCopy relationship until it is explicitly or implicitly terminated.
No copy Does not perform a background copy of the data from the FlashCopy source volume to the target.
Example 41-2 shows a sample DS CLI command to create FlashCopy relationships for Global Mirror to use.
Example 41-2 Create FlashCopy H3:J3
dscli> mkflash -dev IBM.2107-75CYK71 -tgtinhibit -record -persist -nocp 7000-700f:7200-720f
CMUC00137I mkflash: FlashCopy pair IBM.2107-75CYK71/7000:IBM.2107-75CYK71/7200 successfully created.
...
CMUC00137I mkflash: FlashCopy pair IBM.2107-75CYK71/700F:IBM.2107-75CYK71/720F successfully created.
The creation of the FlashCopy relationships can be verified as shown in Example 41-3.
Example 41-3 List FlashCopy relationships
dscli> lsflash -dev IBM.2107-75CYK71 7000-700f
ID SrcLSS SequenceNum Timeout ActiveCopy Recording Persistent Revertible SourceWriteEnabled TargetWriteEnabled BackgroundCopy
===========================================================================================================
IBM.2107-75CYK71/7000:IBM.2107-75CYK71/7200 IBM.2107-75CYK71/70 0 60 Disabled Enabled Enabled Disabled Enabled Disabled Disabled
...
IBM.2107-75CYK71/700F:IBM.2107-75CYK71/720F IBM.2107-75CYK71/70 0 60 Disabled Enabled Enabled Disabled Enabled Disabled Disabled
41.2.6 Create and start Global Mirror session
The Global Mirror session is created. Example 41-4 shows sample DS CLI commands to create a session, start the session, and then query to show the session status. In this simple example, there are no external subordinates.
Note, that the -volpair option is used for the mksession command. There is also a -volume option that was used in the past to specify the primary volume, but for a multiple target PPRC environment, you have to use the -volpair option to specify the primary volume and the target volume.
Example 41-4 Create Global Mirror session
dscli> mksession -volpair 5000-500f:7000-700f -dev IBM.2107-75CZM21 -remotedev IBM.2107-75CYK71 -lss 50 01
CMUC00145I mksession: Session 01 opened successfully.
 
dscli> mkgmir -dev IBM.2107-75CZM21 -lss 50 -session 01
CMUC00162I mkgmir: Global Mirror for session 01 successfully started.
 
dscli> lsgmir -dev IBM.2107-75CZM21 -session 01 50
SessionID MasterID ID State %Success CGtime
 
0x01 IBM.2107-75CZM21 50 Running 100 11/17/20nn 23:24:42 CET
At this point, there is a Metro Mirror and Global Mirror Multiple Target PPRC configuration, which is illustrated in Figure 41-3.
Figure 41-3 Metro Mirror and Global Mirror
41.3 Outage at H3
A failure or planned outage at the Global Mirror remote site H3 can cause the Global Copy pairs to suspend and the Global Mirror session to stop forming consistency groups. The Metro Mirror pairs to H2 continue to run and provide protection in case of a outage at H1. When site H3 is recovered, Global Mirror H1:H3 can be resumed to restore the Global Mirror protection.
41.4 Outage at H2
A failure or planned outage at the secondary site H2 can cause the Metro Mirror pairs H1:H2 to suspend. Global Mirror to H3 continues to provide disaster recovery protection in case of a failure at H1. When site H2 is recovered, Metro Mirror H1:H2 can be resumed to restore the Metro Mirror protection.
41.5 Outage at H1
The sections that follow describe the steps that are taken in the case of a failure or planned outage at the local production H1 site. In a Metro Mirror and Global Mirror configuration, a swap to the Metro Mirror secondary site H2 can be performed.
41.5.1 Recover at H2
First, use HyperSwap or a traditional restart to move production to H2 without interrupting host I/O.
Freeze H1:H2 and H1:H3
Freeze commands for H1:H2 and H1:H3 remove the PPRC paths and suspend all PPRC pairs for H1:H2 and H1:H3. A separate freeze command is required for each LSS-to-LSS PPRC relationship.
With the use of consistency groups, the freeze command creates consistent data at the remote H2 site by using extended long busy or queue full to temporarily queue dependent writes.
Depending on the type of failure at H1, the freeze commands might not complete successfully and some or all H1 pairs can remain full-duplex.
Example 41-5 Freeze PPRC Group H1:H2 and H1:H3
dscli> freezepprc -dev IBM.2107-75CZM21 -remotedev IBM.2107-75CYM31 50:60
CMUC00161I freezepprc: Remote Mirror and Copy consistency group IBM.2107-75CZM21/50:IBM.2107-75CYM31/60 successfully created.
 
dscli> freezepprc -dev IBM.2107-75CZM21 -remotedev IBM.2107-75CYK71 50:70
CMUC00161I freezepprc: Remote Mirror and Copy consistency group IBM.2107-75CZM21/50:IBM.2107-75CYK71/70 successfully created.
Unfreeze and run H1:H2 and H1:H3
When all freeze commands have completed, the secondary H2 and H3 sites contain a consistent copy of data. The unfreeze or run command (also known as a consistency group created command) removes the extended long busy or queue-full condition at the local H1 site. An unfreeze command is required for each LSS-to-LSS PPRC relationship.
As with the freeze command, depending on the type of failure at H1, the unfreeze commands might not complete successfully. Example 41-6 shows an example of a DS CLI unfreeze command.
Example 41-6 Consistency group created, H1:H2 and H1:H3
dscli> unfreezepprc -dev IBM.2107-75CZM21 -remotedev IBM.2107-75CYM31 50:60
CMUC00198I unfreezepprc: Remote Mirror and Copy pair IBM.2107-75CZM21/50:IBM.2107-75CYM31/60 successfully thawed.
 
dscli> unfreezepprc -dev IBM.2107-75CZM21 -remotedev IBM.2107-75CYK71 50:70
CMUC00198I unfreezepprc: Remote Mirror and Copy pair IBM.2107-75CZM21/50:IBM.2107-75CYK71/70 successfully thawed.
Failover H2:H1 and H3:H1
The failover command for H2:H1 converts the H2 volumes to suspended Metro Mirror primary volumes whose secondary volumes are H1. Similarly, the failover H3:H1 converts the H3 volumes to suspended primary Global Copy volumes whose secondary volumes are H1.
Example 41-7 and Example 41-8 show DS CLI examples of the failover commands for H2:H1 and H3:H1, respectively.
Example 41-7 Failover H2:H1
dscli> failoverpprc -dev IBM.2107-75CYM31 -remotedev IBM.2107-75CZM21 -type mmir 6000-600f:5000-500f
CMUC00196I failoverpprc: Remote Mirror and Copy pair IBM.2107-75CYM31/6000:IBM.2107-75CZM21/5000 successfully reversed.
...
CMUC00196I failoverpprc: Remote Mirror and Copy pair IBM.2107-75CYM31/600F:IBM.2107-75CZM21/500F successfully reversed.
Example 41-8 Failover H3:H1
dscli> failoverpprc -dev IBM.2107-75CYK71 -remotedev IBM.2107-75CZM21 -type gcp 7000-700f:5000-500f
CMUC00196I failoverpprc: Remote Mirror and Copy pair IBM.2107-75CYK71/7000:IBM.2107-75CZM21/5000 successfully reversed.
...
CMUC00196I failoverpprc: Remote Mirror and Copy pair IBM.2107-75CYK71/700F:IBM.2107-75CZM21/500F successfully reversed.
At this point, each volume on H1, H2, and H3 is a suspended primary volume pointing to the other two sites as shown in Figure 41-4 on page 479. Specifically, the pair states are as follows:
H1 suspended primary to H2
H1 suspended primary to H3
H2 suspended primary to H1
H2 suspended primary to H3
H3 suspended primary to H1
H3 suspended primary to H2
Example 41-9 shows that the H1:H2 and H1:H3 pairs are suspended due to the freeze commands. If H1 is inaccessible due to a failure, the freeze commands might not be possible and a query might not be possible, either.
Example 41-9 lspprc for H1 pairs
dscli> lspprc -dev IBM.2107-75CZM21 5000-500f
ID State Reason Type SourceLSS
=============================================================================================
IBM.2107-75CZM21/5000:IBM.2107-75CYK71/7000 Suspended Freeze Global Copy IBM.2107-75CZM21/50 ...
IBM.2107-75CZM21/5000:IBM.2107-75CYM31/6000 Suspended Freeze Metro Mirror IBM.2107-75CZM21/50 ...
...
IBM.2107-75CZM21/500F:IBM.2107-75CYK71/700F Suspended Freeze Global Copy IBM.2107-75CZM21/50 ...
IBM.2107-75CZM21/500F:IBM.2107-75CYM31/600F Suspended Freeze Metro Mirror IBM.2107-75CZM21/50 ...
Example 41-10 shows that the H2:H1 pairs are suspended from the failover H2:H1 command. The -multtgt option is used to include the H2:H3 MTIR pairs in the output.
Example 41-10 lspprc for H2 pairs
dscli> lspprc -dev IBM.2107-75CYM31 -multtgt 6000-600f
ID State Reason Type SourceLSS
============================================================================================================
IBM.2107-75CYM31/6000:IBM.2107-75CYK71/7000 Suspended Multi-target Internal Global Copy IBM.2107-75CYM31/60 ...
IBM.2107-75CYM31/6000:IBM.2107-75CZM21/5000 Suspended Host Source Metro Mirror IBM.2107-75CYM31/60 ...
...
IBM.2107-75CYM31/600F:IBM.2107-75CYK71/700F Suspended Multi-target Internal Global Copy IBM.2107-75CYM31/60 ...
IBM.2107-75CYM31/600F:IBM.2107-75CZM21/500F Suspended Host Source Metro Mirror IBM.2107-75CYM31/60 ...
Example 41-11 shows that the H3:H1 pairs are suspended from the failover H3:H1 command. The -multtgt option is used to also include the H3:H2 MTIR pairs in the output.
Example 41-11 lspprc for H3 pairs
dscli> lspprc -dev IBM.2107-75CYK71 -multtgt 7000-700f
ID State Reason Type SourceLSS
===========================================================================================================
IBM.2107-75CYK71/7000:IBM.2107-75CYM31/6000 Suspended Multi-target Internal Global Copy IBM.2107-75CYK71/70 ...
IBM.2107-75CYK71/7000:IBM.2107-75CZM21/5000 Suspended Host Source Global Copy IBM.2107-75CYK71/70 ...
...
IBM.2107-75CYK71/700F:IBM.2107-75CYM31/600F Suspended Multi-target Internal Global Copy IBM.2107-75CYK71/70 ...
IBM.2107-75CYK71/700F:IBM.2107-75CZM21/500F Suspended Host Source Global Copy IBM.2107-75CYK71/70 ...
Resume host systems at H2
Host systems can be restarted at H2. If HyperSwap is used, the host I/O is switched to H2. At this point, the host systems are running at H2, and the configuration appears as in Figure 41-4.
Figure 41-4 After recovery at H2
Start replication H2:H3
The Incremental Resynchronization capability is used to start replication H2:H3. With the change recording function of Multiple Target PPRC, only the tracks that are potentially out of synchronization between H2 and H3 are transferred, and a full copy of data is not required.
This Incremental Resynchronization capability operates the same for Global Copy and Global Mirror pairs as it does for Metro Mirror. Even though H2 was a Metro Mirror secondary and H3 was a Global Mirror scenario, the Incremental Resynchronization is still possible.
Failback H2:H3
A failback command for H2:H3 merges the change recording bitmap files from H2 and H3 and initiates the transfer of the out-of-synchronization data. Example 41-12 shows a sample DS CLI for the failback command.
Example 41-12 Failback H2:H3
dscli> failbackpprc -dev IBM.2107-75CYM31 -remotedev IBM.2107-75CYK71 -type gcp 6000-600f:7000-700f
CMUC00197I failbackpprc: Remote Mirror and Copy pair IBM.2107-75CYM31/6000:IBM.2107-75CYK71/7000 successfully failed back.
...
CMUC00197I failbackpprc: Remote Mirror and Copy pair IBM.2107-75CYM31/600F:IBM.2107-75CYK71/700F successfully failed back.
At this point in the process, the H2:H3 pairs have been resumed. The state of the configuration is as shown in Figure 41-5, with Global Copy now active from H2 to H3.
Figure 41-5 After failback H2:H3 with Incremental Resynchronization
Start Global Mirror H2:H3
Global Copy is running for H2:H3 and transferring data. The FlashCopy journal volumes at J3 contain the last consistency group that was formed before the failure at H1. Example 41-13 on page 481 shows the next step, which is to start Global Mirror from H2:H3 and resume the formation of Global Mirror consistency groups.
Example 41-13 Start Global Mirror H2:H3
dscli> mksession -volpair 6000-600f:7000-700f -dev IBM.2107-75CYM31 -remotedev IBM.2107-75CYK71 -lss 60 01
CMUC00145I mksession: Session 01 opened successfully.
 
dscli> mkgmir -dev IBM.2107-75CYM31 -lss 60 -session 01
CMUC00162I mkgmir: Global Mirror for session 01 successfully started.
Global Mirror is started for H2:H3 by using the same FlashCopy volumes on H3, and consistency group formation is resumed, as shown in Example 41-14.
Example 41-14 Query showing consistency group formation
dscli> lsgmir -dev IBM.2107-75CYM31 -session 01 60
SessionID MasterID ID State %Success CGtime
======================================================================
0x01 IBM.2107-75CYM31 60 Running 100 mm/dd/yyyy hh:mm:ss TZ
41.5.2 H1 recovered
When site H1 is recovered, mirroring can be resumed to H2 to restore the Multiple Target PPRC configuration.
Pause or remove Global Mirror H1:H3
H1 has Global Mirror running for H1:H3. Because the Global Copy pairs H1:H3 are suspended, Global Mirror is unable to form consistency groups. The Global Mirror session can be either paused or removed.
Example 41-15 shows a DS CLI command to pause the Global Mirror session, followed by a query showing that the state is now paused.
Example 41-15 Pause Global Mirror H1:H3
dscli> pausegmir -dev IBM.2107-75CZM21 -lss 50 -session 01
CMUC00163I pausegmir: Global Mirror for session 01 successfully paused.
...
dscli> lsgmir -dev IBM.2107-75CZM21 -session 01 50
SessionID MasterID ID State %Success CGtime
=====================================================================
0x01 IBM.2107-75CZM21 50 Paused 95 11/18/20nn 10:11:31 CET
Alternatively, the Global Mirror H1:H3 session can be ended by removing the Global Copy pairs from the session and then removing the session, as shown in Example 41-16.
Example 41-16 Stop Global Mirror H1:H3
dscli> chsession -volpair 5000-500f:7000-700f -dev IBM.2107-75CZM21 -remotedev IBM.2107-75CYK71 -lss 50 -action remove 01
CMUC00147I chsession: Session 01 successfully modified.
 
dscli> rmsession -dev IBM.2107-75CZM21 -lss 50 -quiet 01
CMUC00146I rmsession: Session 01 closed successfully.
Establish paths H1:H2 and H1:H3
The paths H1:H2 and H1:H3 were removed by the freeze commands issued in 41.5.1, “Recover at H2” on page 477. After H1 is recovered, these paths need to be reestablished. The paths are not required until the time when mirroring is later resumed from H1:H2 and H1:H3, but establishing them as soon as H1 is recovered helps to ensure that they are available when needed.
The paths are re-established by using the same commands that were used to create the paths.
Failback H2:H1
A failback command for H2:H1 resumes the H2:H1 Metro Mirror pairs, as shown in Example 41-17.
Example 41-17 Failback H2:H1
dscli> failbackpprc -dev IBM.2107-75CYM31 -remotedev IBM.2107-75CZM21 -type mmir 6000-600f:5000-500f
CMUC00197I failbackpprc: Remote Mirror and Copy pair IBM.2107-75CYM31/6000:IBM.2107-75CZM21/5000 successfully failed back.
...
CMUC00197I failbackpprc: Remote Mirror and Copy pair IBM.2107-75CYM31/600F:IBM.2107-75CZM21/500F successfully failed back.
Site H2 is now a Multiple Target PPRC primary with Metro Mirror H2:H1 and Global Mirror H2:H3. The suspended pairs that existed between the two secondary sites H1 and H3 are automatically converted by the DS8000 to MTIR pairs. Example 41-18 shows an lspprc command issued at H1, showing that it is now a Metro Mirror target of H2 and also has MTIR pairs to H3. Compare this to the query of H1 shown in Example 41-9 on page 478, which was issued before the failback H2:H1, to see how the DS8000 has created the MTIR pair relationships.
Example 41-18 lspprc at H1 showing H1:H3 MTIR pairs
dscli> lspprc -dev IBM.2107-75CZM21 -multtgt 5000-500f
ID State Reason Type SourceLSS
=====================================================================================================================
IBM.2107-75CYM31/6000:IBM.2107-75CZM21/5000 Target Full Duplex - Metro Mirror IBM.2107-75CYM31/60...
...
IBM.2107-75CYM31/600F:IBM.2107-75CZM21/500F Target Full Duplex - Metro Mirror IBM.2107-75CYM31/60...
IBM.2107-75CZM21/5000:IBM.2107-75CYK71/7000 Suspended Multi-target Internal Global Copy IBM.2107-75CZM21/50...
...
IBM.2107-75CZM21/500F:IBM.2107-75CYK71/700F Suspended Multi-target Internal Global Copy IBM.2107-75CZM21/50...
After the H2:H3 pairs reach full-duplex, the Multiple Target PPRC configuration has been restored, as shown in Figure 41-6. This is now the same topology as the initial state with Metro Mirror and Global Mirror.
Figure 41-6 Metro Mirror and Global Mirror topology restored
You can compare Figure 41-3 on page 476 with Figure 41-6 to see that it is the same general topology, but now the host systems are now running at H2 rather than H1. Depending upon the specific circumstances, for example if H1 and H2 are local to each other, there might be no preference for running at one site versus the other.
In other situations, there might be reasons to prefer that the host systems run at site H1. Returning to H1 involves the same sequence of steps as the move from H1 to H2. This move back will be a planned move, although the original move from H1 to H2 might have been performed due to a failure event at H1.
41.6 Scripts for managing Metro Mirror/Global Mirror
The best solution is to use a management software like Copy Services Manager or GDPS for z/OS environments. If you do not have either, prepare scripts to manage your environment.
You can prepare DS CLI scripts with all the commands, but DS CLI scripts have the disadvantage that execution stops when there is an error in one line of the script, which can be caused by a volume that is not in the expected state, for example. With many thousand volume-pairs, it is more practical to let the script run for all volumes and treat the exceptions later instead of stopping the script. Therefore, we use Windows batch files.
Because in most commands you have to deal with the same pairs, this example creates input files with the Metro Mirror pairs, the Global Mirror pairs, and the FlashCopy pairs for Global Mirror as shown in Example 41-19.
Example 41-19 Input files with pair definitions
Input file: all-h1h2-mm-pairs.txt
A000-A07F:B000-B07F
A100-A17F:B100-B17F
A200-A27F:B200-B27F
A300:B300
 
Input file: all-h1h3-gm-pairs.txt
A000-A07F:C000-C07F
A100-A17F:C100-C17F
A200-A27F:C200-C27F
A300:C300
 
Input file: all-h3-fc-pairs.txt
C000-C07F:D000-D07F
C100-C17F:D100-D17F
C200-C27F:D200-D27F
C300:C300
The sample scripts provided here are only a suggestion and are in no way complete. For some tasks like establishing paths or freeze/unfreeze, we prepare separate scripts.
To make the scripts more flexible, we use a .ini file and call it pprcconfig.ini to define the environment, access to the DS8000 systems and set variables for the input files, as shown in Example 41-20.
Example 41-20 The pprcconfig.ini file
all-mm-ps-pairs=..inputall-h1h2-mm-pairs.txt
mm-mkpprcpath-P2S=..inputmkpprcpath-h1-h2.txt
mm-mkpprcpath-S2P=..inputmkpprcpath-h2-h1.txt
mm-freezeunfreeze-P2S=..inputfreezeunfreeze-h1-h2.txt
all-gm-ps-pairs=..inputall-h1h3-gm-pairs.txt
gm-mkpprcpath-P2S=..inputmkpprcpath-h1-h3.txt
gm-mkpprcpath-S2P=..inputmkpprcpath-h3-h1.txt
all-gm-mksession=..inputmksession-h1.txt
all-gm-fc-pairs=..inputall-h3-fc-pairs.txt
pname=D86
pdev=IBM.2107-75FAW81
pdsclicmd="C:Program Files (x86)IBMdsclidscli.exe" -hmc1 p.p.p.p -user p -passwd pw
sname=D84
sdev=IBM.2107-75ACA91
sdsclicmd="C:Program Files (x86)IBMdsclidscli.exe" -hmc1 s.s.s.s -user s -passwd sw
gname=D70
gdev=IBM.2107-75ZA181
gdsclicmd="C:Program Files (x86)IBMdsclidscli.exe" -hmc1 g.g.g.g -user g -passwd gw
gm-session-nr=01
gm-master-lss=A0
Example 41-21 shows the scripts to establish the paths or define the sessions.
Example 41-21 Scripts to establish paths, freeze/unfreeze and define sessions
mkpprcpath-h1-h2.txt:
mkpprcpath -dev IBM.2107-75FAW81 -remotedev IBM.2107-75ACA91 -remotewwnn                 5005076303FFD13E -srclss A0 -tgtlss B0 I0332:I0330 I0200:I0210
mkpprcpath -dev IBM.2107-75FAW81 -remotedev IBM.2107-75ACA91 -remotewwnn                 5005076303FFD13E -srclss A1 -tgtlss B1  I0332:I0330 I0200:I0210
:
freezeunfreeze-h1-h2.txt
freezepprc -dev IBM.2107-75FAW81 -remotedev IBM.2107-75ACA91 A0:B0 A1:B1 A2:B2..
unfreezepprc -dev IBM.2107-75FAW81 -remotedev IBM.2107-75ACA91 A0:B0 A1:B1 A2:B2..
 
mksession-h1.txt
mksession -dev IBM.2107-75FAW81 -lss A0 01
mksession -dev IBM.2107-75FAW81 -lss A1 01
mksession -dev IBM.2107-75FAW81 -lss A2 01
mksession -dev IBM.2107-75FAW81 -lss A3 01
Now we can use our first script to set up a Metro Mirror environment as shown in Example 41-22.
Example 41-22 Script: 1-create-all-MM-pairs.bat
ECHO off
for /F "tokens=*" %%K in (..inputpprcconfig.ini) do set %%K
rem
ECHO Create new MM pairs Prim to Sec. To continue press ENTER
pause
setlocal enabledelayedexpansion
rem
set outfile="..output"%DATE%-1-all-create-MM-pairs-P2S.txt
del %outfile% 2>nul
rem
rem Establish Paths Prim to Sec
rem
%pdsclicmd% -script %mm-mkpprcpath-P2S% >> %outfile%
rem
rem Establish pairs
rem
FOR /F "tokens=*" %%i IN ( %all-mm-ps-pairs% ) DO (
%pdsclicmd% mkpprc -dev %pdev% -remotedev %sdev% -type mmir -mode full                                                     -tgtonline %%i >> %outfile%
)
ECHO Output in: %outfile%
pause
We first parse the pprcconfig.ini file and set the variables. We define an output file and put the date in front of the file name. We establish the paths and then take the input file with all the pair definitions for the Metro Mirror relationship and establish the pairs.
 
Important: Some DS CLI commands are shown here in two lines for better reading, but they must be entered on one line.
In a similar way, Example 41-23 establishes the Global Mirror environment.
Example 41-23 1-create-gm-h1-to-h3.bat
ECHO off
for /F "tokens=*" %%K in (..inputpprcconfig.ini) do set %%K
rem
ECHO Establish Global Mirror from %pname% to %gname%. To continue press ENTER
pause
setlocal enabledelayedexpansion
set outfile="..output"%DATE%-1-all-create-GM-%pname%-2-%gname%.txt
del %outfile% 2>nul
rem
rem Establish Paths
rem
%pdsclicmd% -script %gm-mkpprcpath-P2S% >> %outfile%
rem
rem Establish pairs
rem
FOR /F "tokens=*" %%i IN ( %all-gm-ps-pairs% ) DO (
%pdsclicmd% mkpprc -dev %pdev% -remotedev %gdev% -type gcp -mode full                                                     -tgtonline %%i >> %outfile%
)
rem
rem Establish FlashCopies on h3
rem
FOR /F "tokens=*" %%i IN ( %all-gm-fc-pairs% ) DO (
%gdsclicmd% mkflash -dev %gdev% -tgtinhibit -record -nocp -persist %%i >>                                                                         %outfile%
)
rem Define Global Mirror Sessions on h1
rem
%pdsclicmd% -script %all-gm-mksession% >> %outfile%
rem
rem Add volumes to Global Mirror Session
rem
FOR /F "tokens=*" %%i IN ( %all-gm-ps-pairs% ) DO (
set paar=%%i
set lss=!paar:~0,2!
%pdsclicmd% chsession -dev %pdev% -remotedev %gdev% -lss !lss! -action add                                      -volpair %%i %gm-session-nr% >> %outfile%
)
rem
rem Start Global Mirror Session
rem
%pdsclicmd% mkgmir -dev %pdev% -lss %gm-master-lss% -cginterval 0 -coordinate 50                                  -drain 300 -session %gm-session-nr% >> %outfile%
rem
ECHO Output in: %outfile%
pause
 
Examine the output: These scripts are only a suggestion. They do not perform any error checking. At the least, you have to examine the output.
Example 41-24 shows a failover to H2 that reverses the pairs of the input file.
Example 41-24 2-failover-mm-to-h2.bat
ECHO off
for /F "tokens=*" %%K in (..inputpprcconfig.ini) do set %%K
rem
ECHO Switch to %sname% with freeze and unfreeze of all %pname%-volumes.
ECHO To continue press ENTER
pause
setlocal enabledelayedexpansion
set outfile="..output"%DATE%-2-all-MM-failover-to-%sname%-with-freeze.txt
del %outfile% 2>nul
rem
rem Freeze and unfreeze of all pairs
rem
%pdsclicmd% -script %mm-freezeunfreeze-P2S% >> %outfile%
rem
rem Failover:
rem
FOR /F "tokens=*" %%i IN ( %all-mm-ps-pairs% ) DO (
set paar=%%i
set pvol=!paar:~0,9!
IF "!paar:~4,1!"==":" set pvol=!paar:~0,4!
set svol=!paar:~10,9!
IF "!paar:~4,1!"==":" set svol=!paar:~5,4!
%sdsclicmd% failoverpprc -dev %sdev% -remotedev %pdev% -type mmir -tgtonline                                                     !svol!:!pvol! >> %outfile%
)
ECHO Output in: %outfile%
pause
You can now perform a failback from H1 to H2 as shown in Example 41-25 or a failback from H2 to H1.
Example 41-25 3-mm-failback-h1-to-h2.bat
ECHO off
setlocal enabledelayedexpansion
for /F "tokens=*" %%K in (..inputpprcconfig.ini) do set %%K
rem
ECHO MM failback (resync) %pname% to %sname%. Volumes at %sname% should be                                               offline!!! To continue press ENTER
pause
rem
set outfile="..output"%DATE%-3-all-failback-MM-%pname%-to-%sname%.txt
del %outfile% 2>nul
rem
rem
rem Establish paths
rem
%pdsclicmd% -script %mm-mkpprcpath-P2S% >> %outfile%
rem
rem Failback (resync) H1 to H2
rem
FOR /F "tokens=*" %%i IN ( %all-mm-ps-pairs% ) DO (
%pdsclicmd% failbackpprc -dev %pdev% -remotedev %sdev% -type mmir -tgtonline                                                                 %%i >> %outfile%
)
ECHO Output in: %outfile%
pause
Example 41-26 4-mm-failback-h2-to-h1.bat
ECHO off
setlocal enabledelayedexpansion
for /F "tokens=*" %%K in (..inputpprcconfig.ini) do set %%K
rem
ECHO MM failback %sname% to %pname%. Attention!! Reverse direction. All %pname%                            volumes should be offline!!. To continue press ENTER
pause
rem
set outfile="..output"%DATE%-4-all-failback-MM-pairs-%sname%-to-%pname%.txt
del %outfile% 2>nul
rem
rem We make sure the paths back exist
rem
%sdsclicmd% -script %mm-mkpprcpath-S2P% >> %outfile%
rem
rem Failback (resync) backwards
rem
FOR /F "tokens=*" %%i IN ( %all-mm-ps-pairs% ) DO (
set paar=%%i
set pvol=!paar:~0,9!
IF "!paar:~4,1!"==":" set pvol=!paar:~0,4!
set svol=!paar:~10,9!
IF "!paar:~4,1!"==":" set svol=!paar:~5,4!
%sdsclicmd% failbackpprc -dev %sdev% -remotedev %pdev% -type mmir -tgtonline                                                      !svol!:!pvol! >> %outfile%
)
ECHO Output in: %outfile%
pause
Because the last step did a failback H2 to H1, you now want to reverse the pairs with the script shown in Example 41-27. You have to make sure that the H2 to H1 pairs are all Duplex before reversing the pairs. So, you also need a script to query the pairs, which is not shown here, because these scripts are not complete.
Example 41-27 5-reverse-mm-pairs.bat
ECHO off
setlocal enabledelayedexpansion
for /F "tokens=*" %%K in (..inputpprcconfig.ini) do set %%K
rem
ECHO Reverse all MM pairs from %sname%2%pname% to %pname%2%sname%. All                                                     hosts/servers must be down!!!
ECHO Have you verified that all pairs are in DUPLEX state? If not, EXIT with                                                   Ctrl+C. To continue press ENTER
pause
rem
set outfile="..output"%DATE%-5-reverse-MM-pairs-%sname%2%pname%-                                                             to-%pname%2%sname%.txt
del %outfile% 2>nul
rem
rem Suspend all MM volumes at secondary (current production) site
rem
FOR /F "tokens=*" %%i IN ( %all-mm-ps-pairs% ) DO (
set paar=%%i
set pvol=!paar:~0,9!
IF "!paar:~4,1!"==":" set pvol=!paar:~0,4!
set svol=!paar:~10,9!
IF "!paar:~4,1!"==":" set svol=!paar:~5,4!
%sdsclicmd% pausepprc -dev %sdev% -remotedev %pdev% !svol!:!pvol! >> %outfile%
)
rem
rem Failoverpprc at primary site
rem
FOR /F "tokens=*" %%i IN ( %all-mm-ps-pairs% ) DO (
%pdsclicmd% failoverpprc -dev %pdev% -remotedev %sdev% -type mmir -multtgt                                                       -tgtonline %%i >> %outfile%
)
rem
rem Make sure paths exist
rem
%pdsclicmd% -script %mm-mkpprcpath-P2S% >> %outfile%
rem
rem Failbackpprc H1 to H2
rem
FOR /F "tokens=*" %%i IN ( %all-mm-ps-pairs% ) DO (
%pdsclicmd% failbackpprc -dev %pdev% -remotedev %sdev% -type mmir -tgtonline                                                                %%i >> %outfile%
)
ECHO Output in: %outfile%
pause
There is one parameter worth mentioning here. On the failoverpprc command H1 to H2, you need to specify the -multtgt parameter because H1 is a multiple target source. Without this parameter, the following failbackpprc H1 to H2 fails.
Many more scripts are needed to manage the environment. This chapter shows only a few examples. Similar scripts can be created for the Global Mirror part.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.132.97