Running HMC commands from the System i
We've just upgraded to a System i 550 with the Hardware management Console. One of the things this lets us do is to switch the tape drive between partitions directly from the 550, without needing to schedule the resource switch in advance. This is done using
OpenSSH (Secure SHell) running in PASE. There is a simple overview of the process as an IBM Technote -
Sending HMC Commands from a CL Program and a much more in-depth Redpaper on using SSH on the iSeries / System i on the IBM Redbooks site -
Securing Communications with OpenSSH on IBM i5/OS. The tech note is pretty much all that's required to get things running, along with the pre-requisite i5/OS licensed programs:
- 5733SC1 - IBM Portable Utilities for i5/OS
- 5722SS1 - Option 33 - i5/OS PASE - Portable Applications Solutions Environment (a subset of the AIX runtime environment)
The tech note includes a sample CL program to move a resource, using the
chhwres
Change Hardware Resource command, but doesn't go into how this resource is identified.
chhwres
doesn't refer to System i card slots directly. Instead it needs the DRC index of the slot. You need to use another HMC command,
lshwres
List Hardware Resources, to find the DRC index for the slots you are interested in, and plug them into
chhwres
. This is covered on page 54 of the Redpaper.
In our case I used
lshwres -r io --rsubtype slot -m Server-9406-550-SNxxxxx -F phys_loc,drc_index --header --filter units=U0588.002.6537735
where
Server-9406-550-SNxxxxx
is our system name, as shown by the HMC (xxxxxxx is the system serial number would be), and
U0588.002.6537735
is the system/expansion unit (you can determine this from
WRKHDWRSC *STG
then taking option 7 against the Storage Controller resource). The output is like this:
phys_loc,drc_index
C11,21010020
C12,21020020
C13,21030020
C14,21040020
C15,21050020
C01,21010021
C02,21020021
C03,21030021
C04,21040021
C05,21010022
C06,21020022
C07,21030022
C08,21040022
C09,21050022
Our 3583 LTO2 tape library (PCI Fibre Channel Tape Controller) is on slot C04 (DRC index 21040021) and the PCI I/O processor with it on slot C03 (DRC index 21030021). Both need to be moved to the target LPAR for the tape library to work.
I wrote a couple of commands to make life easier moving the tape drive
FINDTAPE - Find the tape drive
MOVETAPE - Move the tape drive