IBM i Metro Mirror Commands

  • Home
  • /
  • Blog
  • /
  • IBM i Metro Mirror Commands

March 2, 2022

IBM i Metro Mirror Commands

By NickLitten

March 2, 2022

IBM i, iASP, Independent ASP

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 1

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)).

Create Cluster Resource Group

Define the CRG for failover.

Run CRTCRG CLUSTER(PWRHA_CLU) CRG(PWRHA_CRG3) CRGTYPE(DEV) EXITPGM(NONE) USRPRF(*NONE) RCYDMN((DEMOFC *PRIMARY *LAST SITE1) (DEMOHA *BACKUP *LAST SITE1)).

Add ASP Copy Descriptions

Describe source and target copies.

Run ADDASPCPYD ASPCPY(ASPCPYD1) ASPDEV(IASP1) CRG(PWRHA_CRG1) SITE(SITE1) STGHOST(‘10.10.10.10’) USER(DS_USER) PASSWORD(DS_PASSWORD) LOCATION(NODE1) LUN(‘IBM.2107-75AY032’ ‘A010-A013’).

Start Your ASP Session

Link copies for replication.

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.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Join the IBM i Community for FREE Presentations, Lessons, Hints and Tips

>