This is less of a blog, and more of a memory nudger for me! I’ve just been looking at a temporary blip (aka outage) on a clients IBM i Metro Mirror instance. I’m no expert on Metro Mirror, so this journal/blog is to help keep it fresh and I’m sure I will reference back to this again.
What is IBM i Metro Mirror?
IBM i Metro Mirror copies data synchronously between storage systems. You use it for high availability and disaster recovery. It ensures zero data loss when your primary site decides to take an unscheduled nap. PowerHA SystemMirror handles the heavy lifting. It works best for sites within 300 kilometers, unless you enjoy latency that feels like waiting for dial-up internet.
Key features:
Writes data to both source and target before giving you the thumbs-up.
Uses Independent Auxiliary Storage Pool (IASP) to store your precious data.
Switches to the target system faster than you can say “server crash.”
Configured with CL commands like CRTCRG and STRASPSSN.
Example: A grocery chain replicates its stock database across two data centers 80 kilometers apart. If the primary site goes offline, the secondary jumps in like a backup dancer, no data missed. Keep latency under 5 milliseconds, or it’ll feel like your system’s stuck in molasses.
Practical steps:
Create a cluster: Run ADDCLUNODE CLUSTER(PWRHA_CLU) NODE(DEMOFC (‘10.10.10.1’)).
Set up IASP: Run CRTDEVASP DEVD(IASP_LUN) RSRCNAME(IASP_LUN).
Start replication: Run STRASPSSN SSN(ASPSSN1) TYPE(*METROMIR).
Check status: Run DSPASPCPYD ASPCPY(MYCOPY) OUTPUT(*PRINT).
Test your setup in a lab, unless you want your production system to throw a surprise party.
Use DSPASPSTS to confirm IASP status after switches.
IBM i Metro Mirror Commands
Set Up Your Cluster
Start with cluster creation. Use these commands to build the foundation.
Add nodes to your cluster. Run ADDCLUNODE CLUSTER(PWRHA_CLU) NODE(DEMOFC (‘10.10.10.1’)).
Add nodes to a device domain. Run ADDDEVDMNE CLUSTER(PWRHA_CLU) DEVDMN(PWRHA_DMN) NODE(DEMOFC).
Create Your IASP
Configure independent auxiliary storage pools. These hold your replicated data.
Create the device ASP. Run CRTDEVASP DEVD(IASP_LUN) RSRCNAME(IASP_LUN).
Configure the ASP device. Run CFGDEVASP ASPDEV(IASP_LUN) ACTION(*CREATE) UNITS(DD026 DD025 DD024 DD023).
Balance data across disks. Run STRASPBAL ASPDEV(IASP1) OPTION(*BALANCE).
Verify configuration. Run VRYCFG CFGOBJ((ASPDEV IASP1)).
Run STRASPSSN SSN(ASPSSN1) TYPE(METROMIR) ASPCPY(ASPCPYD1 ASPCPYD2) FLASHTYPE(NOCOPY) PERSISTENT(*NO).
Manage Your Session
Change session options as needed.
Suspend or resume. Run CHGASPSSN SSN(ASPSSN1) OPTION(*SUSPEND).
Detach copies. Run CHGASPSSN SSN(SVC_GM) OPTION(*DETACH).
Reattach copies. Run CHGASPSSN SSN(SVC_GM) OPTION(REATTACH) SNDINQMSG(YES).
End the session. Run ENDASPSSN SSN(IASP1SSN).
Display session details. Run DSPSVCSSN SSN(SVC_MM) OUTPUT(*PRINT).
Switch Over
Perform planned switches.
Change CRG primary. Run CHGCRGPRI CLUSTER(PWRHA_CLU) CRG(PWRHA_CRG3).
Switch PPRC. Run SWPPRC ENVIRONMENT(TOOLKIT) SWITCHTYPE(UNSCHEDULED) TYPE(MMIR) AUTOREPLICATE(DFT) AUTOVARYON(YES) SWITCHPAUSEDMMIR(*NO).
Check PPRC readiness. Run CHKPPRC ENVIRONMENT(TOOLKIT).
Monitor and Verify
Display ASP copy. Run DSPASPCPYD ASPCPY(MYCOPY) OUTPUT(*PRINT).
Work with copy environments. Run WRKCSE.
Run DS commands. Run RUNDSCMD COLUMNPOSITION(1) EXPECTEDVALUE(‘CMUC00234I’).
You can set up a basic Metro Mirror in 10 steps with these commands. Obviously (duh!) test in a lab first. Use DSPASPSTS to check IASP status after switches.