You are here:
DBG/400
>
DBG400 Web
>
RunningHMCCommands
(01 Oct 2014,
UnknownUser
)
(raw view)
E
dit
A
ttach
---+ Running HMC commands from the System i %TOC% ---++ Background We've just upgraded to a System i 550 with an HMC (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 [[http://www.openssh.org][%ICON{"globe"}% OpenSSH]] (Secure SHell) running in PASE. There is a simple overview of the process as an IBM Technote - [[http://www-1.ibm.com/support/docview.wss?uid=nas1315c113cf5dd9ea0862570de0062e1ce&rs=110][%ICON{"globe"}% 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 - [[http://www.redbooks.ibm.com/redpapers/pdfs/redp4163.pdf][%ICON{"pdf"}% 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) You'll also find the HMC command line documentation essential. See the [[http://www-1.ibm.com/support/docview.wss?uid=nas11804a8132a8e3d8586256fc10065d386][%ICON{"globe"}% Commands Available In Restricted Shell]] Technote and the [[http://www14.software.ibm.com/webapp/set2/sas/f/hmc/power5/tips/home.html][%ICON{"globe"}% Hardware Management Console]] resource page. The latter has a number of links, including for all command line utilities. If you get stuck you can always use the =man= command in an SSH session to the HMC - type =man lshwres= to get the manual page for lshwres, etc. ---++ Details 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 <verbatim> lshwres -r io --rsubtype slot -m Server-9406-550-SNxxxxx -F phys_loc,drc_index --header --filter units=U0588.002.6537735 </verbatim> 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: <verbatim> 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 </verbatim> 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. ---++ Example code I wrote a couple of commands to make life easier moving the tape drive. %ICON{"warning"}% Note that these should be used as example code, as the slots they work with are specific to the system they were written for. Use =lshwres= to find out which slot(s) you need to work with and amend (or re-write) accordingly. Another point to note is the host that the ssh command is run on. I just added a host table entry for =hmc= on our box - we only have the one, and the name seemed the most obvious to choose. You will (equally obviously) need to change it to match your configuration. * FINDTAPE - Find the tape drive * Command source - [[CmdFINDTAPE][FINDTAPE]] * Program source - [[ClFINDSLOTID][FINDSLOTID]] * MOVETAPE - Move the tape drive * Command source - [[CmdMOVETAPE][MOVETAPE]] * Program source - [[ClGETHDWRSC][GETHDWRSC]] There are a few non-IBM commands used in the programs. [[CmdMOVDIAGMSG][MOVDIAGMSG]] and [[CmdRSNESCMSG][RSNESCMSG]] are from Tom Liotta's [[http://zap.to/tl400][%ICON{"globe"}% Sharea]] site. There are several versions of =CHKIFSOBJ=, including a couple by [[http://www.scottklement.com][%ICON{"globe"}% Scott Klement]]. The one I use is an early version Scott posted online, and archived at [[http://www.think400.dk/adhoc_3.htm#eks0019][%ICON{"globe"}% www.think400.dk]]. You could use a =DSPLNK OBJ(&SSHKEY)= with a =MONMSG MSGID(!CPFA0A9)= instead of the =MONMSG(CPF9897)=, but remember to tidy up with a =DLTSPLF FILE(QSYSPRT) SPLNBR(*LAST)= if the file is there. ---++ Future plans I hope to add examples of removing/adding memory and CPU resource at some point, which are just variations on the routines above.
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r4 - 01 Oct 2014 - 19:37:02 -
UnknownUser
DBG400
Log In
DBG400 Web
Index
Search
Changes
Notifications
Statistics
Site Map
Downloads
Webs
DBG400
Jamaro
Main
Sandbox
Sandtub
System
Send a link to this page
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding DBG/400?
Send feedback