HMC commands

root's picture

The IBM Hardware Management Console is a standalone linux based machine which provides a standard user interface for configuring and operating partitioned and SMP systems. The HMC supports the system with features that enable a system administrator to manage configuration and operation of partitions in a system, as well as to monitor the system for hardware problems. It consists of a 32-bit Intel-based desktop PC with a DVD-RAM drive.
Notes: Always consult your HMC manual. Use these commands as is, preferably in testing environment before production. They should work on many hmc/power versions. If there is some command limited to a version, it will be mentioned.

How to list the system connections. This way you can check what error you have if you are not able to see the partitions on a squadron.


hscroot@gzhmc$ lssysconn -r all

How to check if the lpars have connection with the current HMC. This is useful when you have issues related to DLPAR operations.


hscroot@gzhmc$ lspartition -dlpar

Example of working one:

<#36> Partition:<7*9117-MMA*56A3R4A, , 192.168.207.63>
       Active:<1>, OS:<AIX, 6.1, 6100-06-05-1115>, DCaps:<0x2c5f>, CmdCaps:<0x1b, 0x1b>, PinnedMem:<1137>

Example of non-working one:

<#37> Partition:<4*9117-MMA*56A5R9A, , 192.168.207.23>
       Active:<0>, OS:<, , >, DCaps:<0x0>, CmdCaps:<0x0, 0x0>, PinnedMem:<0>

What to do if you reconnect the management system to HMC and it is not recognized (to clear the HMC's connection history):


hscroot@gzhmc$ mksysconn -o auto

How to list 3 days of console events:


hscroot@gzhmc$ lssvcevents -t console -d 3

How to list 3 days of console events for a specific lpar:


hscroot@gzhmc$ lssvcevents -t console -m PARTITION -s ALL -d 3

How to list 3 days of hardware events:


hscroot@gzhmc$ lssvcevents -t hardware -d 3

How to list 3 days of hardware events for a specific lpar:


hscroot@gzhmc$ lssvcevents -t hardware -m PARTITION -s ALL -d 3

How to do HMC restart:


hscroot@gzhmc$ hmcshutdown -r -t0

How to list HMC version:


hscroot@gzhmc$ lshmc -V

How to list HMC hardware information, including the serial number:


hscroot@gzhmc$ lshmc -v

How to list managed systems (enter lssyscfg alone for more):


hscroot@gzhmc$ lssyscfg -r sys -F name

How to list lpars by name, id, state and current profile of LPARNAME:


hscroot@gzhmc$ lssyscfg -m FRAME -r lpar --filter "lpar_names=LPARNAME" -F name,lpar_id,state,curr_profile

How to list lpars by name, id, state and current profile in a managed system:


hscroot@gzhmc$ lssyscfg -m FRAME -r lpar -F name,lpar_id,state,curr_profile

How to list squadron's processors, real and virtual:


hscroot@gzhmc$ lshwres -r proc -m FRAME --level lpar -F lpar_name,curr_proc_units,curr_procs

How to list total processors of the squadron:


hscroot@gzhmc$ lshwres -r mem  -m FRAME --level sys -F configurable_sys_mem installed_sys_mem curr_avail_sys_mem sys_firmware_mem

How to list total memory of the squadron:


hscroot@gzhmc$ lshwres -r mem  -m FRAME --level sys -F configurable_sys_mem installed_sys_mem curr_avail_sys_mem sys_firmware_mem

How to list memory for each lpar in a squadron:


hscroot@gzhmc$ lshwres -r mem -m FRAME --level lpar -F lpar_name,curr_mem

How to display vios from all squadrons:


hscroot@gzhmc$ for FRAME in $(lssyscfg -r sys -F name); do printf "$FRAME\n";lssyscfg -r lpar -m $FRAME -F name,lpar_env|grep vio; done

How to search a partition name on all squadrons:


hscroot@gzhmc$ for FRAME in $(lssyscfg -r sys -F name); do printf "$FRAME:\n";lssyscfg -r lpar -m $FRAME -F name,lpar_env|grep PARTITION; done

How to soft reset a system running in FullPartitionMode (power4):


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

How to hard reset a system running in FullPartitionMode (power4):


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

How to soft reset LPAR partition via HMC:


power4:
hscroot@gzhmc$ chsysstate -m FRAME -r lpar -n PARTITION -o reset
power5:
hscroot@gzhmc$ chsysstate -r lpar -m FRAME -o shutdown -n PARTITION

How to stop LPAR partition via HMC:


power4:
hscroot@gzhmc$ chsysstate -m pserver -r lpar -n mylpar -o off
power5:
hscroot@gzhmc$ chsysstate -m FRAME -r lpar -o shutdown -n PARTITION --immed

How to stop LPAR partition via HMC with dump:


hscroot@gzhmc$ chsysstate -m FRAME -r lpar -o dumprestart -n PARTITION

How to start LPAR partition via HMC (use "-b" option to start in different mode than normal, e.g. "sms" for sms menu):


hscroot@gzhmc$ chsysstate -r lpar -m FRAME -n PARTITION -f PROFILE -o on

How to connect to LPAR partition via HMC (via vtmenu or mkvterm):


1. vtmenu

2. select frame

3. select partition number

or:
hscroot@gzhmc$ mkvterm -m FRAME -p PARTITION

How to remove an existing terminal connection:


hscroot@gzhmc$ rmvterm -m FRAME -p PARTITION

How to connect to HMC via ssh tunneling:


1. Connect to gateway as usual but with the additional options highlighted in green: ssh gateway -L 3333:HMCIP:443 (where HMCIP = THE IP OF YOUR HMC)

2. Go to your favorite browser on your station and access the following address: https://localhost:3333

How to check the current disk space on HMC:


hscroot@gzhmc$ monhmc -r disk

How to remove all temporary HMC files from all file systems:


hscroot@gzhmc$ chhmcfs -o f -d 0

How to back up critical HMC data via command line interface:


To DVD:
hscroot@gzhmc$ bkconsdata -r dvd
Via NFS:
hscroot@gzhmc$ bkconsdata -r nfs -h NFSIP -l /hmc/backup/

How to back up partition profile data via command line interface:


hscroot@gzhmc$ bkprofdata -m FRAME -f dvd

How to check the date and time when the last critical console data backup was performed:


hscroot@gzhmc$ lssvcevents -t console -d 9999|grep 'backup of critical'

How to check the date and time when the last profile data backup was performed:


hscroot@gzhmc$ lssvcevents -t console -d 9999|grep 'Profile data'

How to make a new password policy in HMC with hscroot user:

Create it:

hscroot@gzhmc$ mkpwdpolicy –i	\
"name=gzadm,		\
description=,		\
min_pwage=1,		\ 
pwage=180,		\
min_length=4,		\
hist_size=10,		\
warn_pwage=7,		\
min_digits=0,		\
min_uppercase_chars=0,	\
min_lowercase_chars=0,	\
min_special_chars=0"

Activate it:

hscroot@gzhmc$ chpwdpolicy -o a -n gzadm

Change the password:

hscroot@gzhmc$ chhmcusr -u gzadm -t passwd

Disable the policy:

hscroot@gzhmc$ chpwdpolicy -o d

Remove the policy:

hscroot@gzhmc$ rmpwdpolicy -n gzadm

How to list user's settings:


NOTE: these values are all changeable via chhmcusr command.

ibm0htz1@frmpphmb40itdnm:~> lshmcusr --filter "names=hscroot"
name=hscroot,taskrole=hmcsuperadmin,description=HMC Super User,pwage=99999,resourcerole=ALL:,authentication_type=local,remote_webui_access=1,remote_ssh_access=1,min_pwage=0,session_timeout=0,verify_timeout=15,idle_timeout=0,inactivity_expiration=0,resources=<ResourceID = ALL:><UserDefinedName = AllSystemResources>,password_encryption=md5,disabled=0

What to do if you get the following error on DLPAR dynamic operations: HSCL297A There are some mismatches between pending and current values.


Assuming the memory was involved in this error, run the rsthwres command to re-sync the values.

hscroot@gzhmc$ rsthwres -r mem -m FRAME

How to free up partition resources with chhwres command in Power 7:


You have a currently active partition with 0.6 processing units assigned to it and you want to stop it and not using it for a while.

hscroot@gzhmc:~> lparls | grep PARTITION
   PARTITION             Running 
hscroot@gzhmc:~> lparlscpu | grep PARTITION
   PARTITION             0.5

You stop the partition, normally but the 0.6 processing unit remains allocated.

hscroot@gzhmc:~> lparls | grep PARTITION
   PARTITION             Not Activated
hscroot@gzhmc:~> lparlscpu | grep PARTITION
   PARTITION             0.6

Use the chhwres command to free up this resource from the partition:

hscroot@gzhmc:~> chhwres -r proc -m FRAME -o r --id 6 --procunits 0.6
hscroot@gzhmc:~> lparlscpu | grep PARTITION
   PARTITION

Also, the partiton's profile will not be modified:

hscroot@gzhmc:~> lparinfo PARTITION
PARTITION
  On frame FRAME
  Current State:  Not Activated
  OS version: AIX 6.1 6100-05-01-2410
 
  Profile properties:
  Profile properties:
name=Default,lpar_name=PARTITION,lpar_id=6,lpar_env=aixlinux,all_resources=0,
min_mem=512,desired_mem=20480,max_mem=34576,min_num_huge_pages=0,desired_num_huge_pages=0,
max_num_huge_pages=0,mem_mode=ded,hpt_ratio=1:64,proc_mode=shared,min_proc_units=0.1,
desired_proc_units=0.6,max_proc_units=2.0,min_procs=1,desired_procs=4,max_procs=8,
sharing_mode=uncap,uncap_weight=64,shared

If you change your mind and have to start the lpar back, it will re-acquire the 0.6 cores without any problems and without other modifications. END!

Inspiration:
http://www.unixwerk.eu/aix/hmc-howto.html

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself!
Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.