GuestbookSign our guestbook ContactGet in touch with the authors ArchiveAll unixwerk articles since 2003
April 9, 2010

How to use the HMC Commandline

This documents contains the most important HMC commands. It covers both, the old power4 commands (up to HMC Version 3) and the new power5 style commands (HMC Version 4-6). A lot of nice commands still available for version 3 (power4) are removed from newer releases. One example of these nice commands is lslpars and it's not available for HMC version 4 and higher. The real reason behind it is that IBM wants to force us to use the web based tools wsm and WebSM or the new HMC browser GUI. This documents helps you to survive with the HMC commands in case working with the web based tools is not feasible.

In the examples below we call a whole power4 or power5 frame (aka Managed System) pserver. We call an LPAR mylpar. If an example output shows more than one LPAR name we enumerate it. LPAR Profiles are shown as myprofile. You have to replace these names with your object names.

If you use power6 systems, you need the new HMC version7. Although the GUI has changed from wsm to a browser based service, the commandline remains compatible. You can just use the power5 examples for power6.

 

Contents

  1. HMC Version
  2. LPAR Status
  3. Reboot the HMC
  4. Soft Reset of an LPAR
  5. Soft Reset of a Systems Running in FullPartitionMode
  6. Hard Reset of an LPAR
  7. Hard Reset of a Systems Running in FullPartitionMode
  8. Virtual Console
  9. Show Status and LED/LCD Display of an LPAR
  10. Show Status and LED/LCD Display of a Systems Running in FullPartitionMode
  11. Activation of an LPAR
  12. How to Power on a System Running in FullPartitionMode
  13. Bring the key switch to position NORMAL
  14. How to change the HMC password (of user hscroot)
  15. Overview LPAR IDs
  16. Overview Connection State

 

1. HMC Version

hscroot@hmc> lshmc -V
 Version: 3
 Release: 3.2
HMC Build level 20040827.1

power4 HMCs could never show a version higher 3.x - HMC version 4.x and higher are only for power5 systems. Power 6 systems need HMCs version 7.x.

 

2. LPAR Status

That's how you get an overview of all systems controlled by your HMC:

power4:

hscroot@hmc> lslpars

power5:

hscroot@hmc> lssyscfg -r sys -F name:serial_num:state
pserver1:656D24A:Operating
pserver2:656FFFF:Operating

The format string 'lpar_id:name:serial_num:state' also tells you the serial number of the systems. You can omit the field 'serial_num' if you don't need to know.
However, for every system from the list above you get the LPAR overview as shown below:

hscroot@hmc> lssyscfg -m pserver -r lpar -F name:state

Example:

hscroot@hmc> lssyscfg -m pserver1 -r lpar -F name:state
mylpar1:Running
mylpar2:Running
mylpar3:Not Activated

Don't know where to start? Find the managed system to an LPAR with a query:

hscroot@hmc> for m in $(lssyscfg -r sys -F name); do echo $m ; lssyscfg -r lpar -m $m -F name:state ; done

 

3. Reboot the HMC

power4 + power5:

hscroot@hmc> hmcshutdown -t now -r

 

4. Soft Reset of an LPAR

power4:

hscroot@hmc> chsysstate -m pserver -r lpar -n mylpar -o reset

power5:

hscroot@hmc> chsysstate -r lpar -m pserver -o shutdown -n mylpar

 

5. Soft Reset of a System Running in FullPartitionMode

power4:

hscroot@hmc> chsysstate -n pserver -r sys -o reset

 

6. Hard Reset of an LPAR

power4:

hscroot@hmc> chsysstate -m pserver -r lpar -n mylpar -o off

power5:

hscroot@hmc> chsysstate -r lpar -m pseries -o shutdown -n mylpar --immed

 

7. Hard Reset of a System Running in FullPartitionMode

power4:

hscroot@hmc> chsysstate -n pserver -r sys -o off

 

8. Virtual Console

That's how you get a connection to an LPAR's serial console:

power4 + power5:

hscroot@hmc> mkvterm -m pserver -p mylpar

If your system is running in FullSystemPartition-Mode you connect with a command like this:

power4:

hscroot@hmc> mkvterm -m pserver

You can escape from the console connection by typing ~~. (twice tilde followed by a dot)

If you cannot connect to the serial console and you get an error message instead:

All available virtual terminal sessions have been opened and are in use. 
To force a new open session, perform a Close Terminal Session operation
which frees up the session.

there is still another active connection to this console. You can close this connection with:

power4 + power5:

hscroot@hmc> rmvterm -m pserver -p mylpar

 

9. Show Status and LED/LCD Display of an LPAR

power4:

hscroot@hmc> lssyscfg -r lpar -m pserver -n mylpar

power5:


hscroot@hmc> lsrefcode -m pserver -r lpar --filter "lpar_names=mylpar" -F lpar_name:refcode

You can even see the history of LED codes. Just use -n <NUM> for the last NUM codes. For example, if you want to see the last 5 LED codes of an LPAR type

hscroot@hmc> lsrefcode -m pserver -r lpar --filter "lpar_names=mylpar"  -n 5 -F lpar_name:refcode
mylpar:
mylpar:0c33
mylpar:
mylpar:0539
mylpar:0538

... and for the status LEDs:

hscroot@hmc> lsled -m pserver -r sa -t virtuallpar --filter ""lpar_names=mylpar""

 

10. Show Status and LED/LCD Display of a Systems Running in FullPartitionMode

power4:

hscroot@hmc> lssyscfg -r sys -n pserver

 

11. Activation of an LPAR

power4:

hscroot@hmc> chsysstate -r lpar -m pserver -o on [ -f myprofile ] -n mylpar 

power5:

hscroot@hmc> chsysstate -r lpar -m pserver -o on -f myprofile -n mylpar

 

12. How to Power on a System Running in FullPartitionMode

power4:

hscroot@hmc> chsysstate -o on -r sys -n pserver -c full

 

13. Bring the key switch to position NORMAL

This might be necessary on some power5 HMCs when an LPAR does not properly boot after issuing the power on command above. You might see a message like this:

0514-440 cfgcon: failed to create log file: check path name, permissions, and available space

When seeing this you can only access diag mode or boot the LPAR in singleuser mode. This command sets the key switch back to normal position:

power5:

hscroot@hmc> chsysstate -r lpar -o chkey -k norm -n mylpar -m pserver

 

14. How to change the HMC password (of user hscroot)

power4 + power5:

hscroot@hmc> chhmcusr -u hscroot -t passwd
Enter the new password:
Retype the new password:

 

15. Overview LPAR IDs

power5:

hscroot@hmc> lssyscfg -r lpar -m pserver -F lpar_id:name:serial_num:state | sort -n
1:vioserver1:Running
2:vioserver2:Running
3:mylpar1:Not Activated
4:mylpar2:Running
5:mylpar3:Running
6:mylpar4:Running
7:mylpar5:Running
8:mylpar6:Running
9:mylpar7:Running
10:mylpar8:Not Activated

 

16. Overview Connection State

Are all service processors connected to my HMC?

power5:

hscroot@hmc> lssysconn -r all -F type_model_serial_num:ipaddr:state | sort
9117-570*65AE18C:172.16.255.253:Connected
9117-570*65AE18C:172.16.254.255:Connected
9117-570*65AE2AC:172.16.255.254:Connected
9117-570*65AE2AC:172.16.254.254:Connected
9117-570*650D70D:172.16.255.252:Connected
9117-570*650D70D:172.16.253.255:Connected
9117-570*650D71D:172.16.254.253:Connected
9117-570*650D71D:172.16.255.251:Connected
9131-52A*065F7BB:172.16.253.254:Connected
9131-52A*065F8BA:172.16.254.252:Connected

The link to the name of the managed system is the serial number - not the IP address! The IP addresses listed above are mounted on the service processor's private NIC and managed by the integrated DHCP server of the HMC.