How to use the HMC Commandline
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
- HMC Version
- LPAR Status
- Reboot the HMC
- Soft Reset of an LPAR
- Soft Reset of a Systems Running in FullPartitionMode
- Hard Reset of an LPAR
- Hard Reset of a Systems Running in FullPartitionMode
- Virtual Console
- Show Status and LED/LCD Display of an LPAR
- Show Status and LED/LCD Display of a Systems Running in FullPartitionMode
- Activation of an LPAR
- How to Power on a System Running in FullPartitionMode
- Bring the key switch to position NORMAL
- How to change the HMC password (of user hscroot)
- Overview LPAR IDs
- 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:statepserver1:656D24A:Operatingpserver2: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 -mpserver1-r lpar -F name:statemylpar1:Runningmylpar2:Runningmylpar3: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 -mpserver-r lpar -nmylpar-o reset
power5:
hscroot@hmc> chsysstate -r lpar -mpserver-o shutdown -nmylpar
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 -mpserver-r lpar -nmylpar-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 -mpserver-pmylpar
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 -mpserver-pmylpar
9. Show Status and LED/LCD Display of an LPAR
power4:
hscroot@hmc> lssyscfg -r lpar -mpserver-nmylpar
power5:
hscroot@hmc> lsrefcode -mpserver-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 -mpserver-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 -mpserver-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 -mpserver-o on [ -fmyprofile] -nmylpar
power5:
hscroot@hmc> chsysstate -r lpar -mpserver-o on -fmyprofile-nmylpar
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 -nmylpar-mpserver
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 -mpserver-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.
unixwerk