HMC Command Line

1. List the systems connected to the hmc

hscroot@myhmc:~> lssyscfg -r sys -Fname:state:ipaddr                           
system1:Operating:9.x.x.x1
system2:Operating:9.x.x.x2
system3:Operating:9.x.x.x3
system4:Operating:9.x.x.x4
hscroot@myhmc:~> 

Where name state and ipaddr are name, state and fsp ip address of a system.

2. List systems all capabilities 

hscroot@myhmc:~> lssyscfg -r sys -m system1
name=system1,type_model=8286-42A,serial_num=TU00001,ipaddr=9.x.x.x1,sp_type=fsp,state=Operating,detailed_state=None,sys_time=04/13/2020 12:08:59,power_off_policy=1,active_lpar_mobility_capable=1,inactive_lpar_mobility_capable=1,active_lpar_share_idle_procs_capable=1,active_mem_expansion_capable=1,hardware_active_mem_expansion_capable=1,active_mem_mirroring_hypervisor_capable=unavailable,active_mem_sharing_capable=1,addr_broadcast_perf_policy_capable=0,aix_capable=1,bsr_capable=0,capi_capable=0,cod_mem_capable=1,cod_proc_capable=1,dynamic_platform_optimization_capable=1,electronic_err_reporting_capable=1,firmware_power_saver_capable=1,hardware_power_saver_capable=1,hardware_discovery_capable=1,hca_capable=0,huge_page_mem_capable=1,lhea_capable=0,lpar_avail_priority_capable=1,lpar_proc_compat_mode_capable=1,lpar_remote_restart_capable=1,powervm_lpar_simplified_remote_restart_capable=1,dynamic_simplified_remote_restart_toggle_capable=1,powervm_lpar_remote_restart_capable=1,lpar_suspend_capable=1,micro_lpar_capable=1,os400_capable=1,5250_application_capable=1,os400_native_io_capable=1,redundant_err_path_reporting_capable=1,shared_eth_failover_capable=1,sni_msg_passing_capable=0,sp_failover_capable=1,vet_activation_capable=1,virtual_fc_capable=1,virtual_io_server_capable=1,virtual_switch_capable=1,vsn_phase2_capable=1,vsi_on_veth_capable=1,assign_5250_cpw_percent=0,max_lpars=320,max_power_ctrl_lpars=1,max_remote_restart_capable_lpars=320,max_suspend_capable_lpars=320,service_lpar_id=none,"lpar_proc_compat_modes=default,POWER6,POWER6+,POWER7,POWER8",curr_sys_keylock=norm,pend_sys_keylock=norm,curr_power_on_side=temp,pend_power_on_side=temp,curr_power_on_speed=norm,pend_power_on_speed=norm,power_on_type=power on,power_on_option=standby,power_on_lpar_start_policy=userinit,pend_power_on_option=standby,pend_power_on_lpar_start_policy=userinit,power_on_method=02,power_on_attr=0000,sp_boot_attr=5000,sp_boot_major_type=0B,sp_boot_minor_type=09,sp_version=0008000C,mfg_default_config=0,curr_mfg_default_ipl_source=d,pend_mfg_default_ipl_source=d,curr_mfg_default_boot_mode=sms,pend_mfg_default_boot_mode=sms,max_vtpm_lpars=60,vtpm_version=1,cluster_serial_num=none,peer_collective_serial_num=none
hscroot@myhmc:~> 

Above system details are of Low End Power8 System (Tuleta) Box

3. Connect a system to hmc

To connect a system to hmc we require the FSP (Flexible Service Provider) ip and its systems-hmc password

hscroot@myhmc:~> mksysconn --ip FSP-IP -r sys --passwd SYSTEM-HMC_PASSWORD

4. To remove the system or reset the system connect we can run the below command

Remove
hscroot@myhmc:~> rmsysconn --ip FSP-IP -o remove

Reset
hscroot@myhmc:~> rmsysconn --ip FSP-IP -o reset

5. List lpars present in system

hscroot@myhmc:~> lssyscfg -r lpar -m system2 -Fname:state:lpar_env | grep aixlinux 


machinex1:Not Activated:aixlinux

machinex2:Open Firmware:aixlinux

machinex3:Running:aixlinux

machinex4:Running:aixlinux

hscroot@myhmc:~>

To list complete details of lpar

hscroot@myhmc:~> lssyscfg -r lpar -m system2 | grep machinex1
name=machinex1,lpar_id=3,lpar_env=aixlinux,state=Running,resource_config=1,os_version=Unknown,logical_serial_num=133P46X3,default_profile=machinex1,curr_profile=machinex1,work_group_id=none,shared_proc_pool_util_auth=0,allow_perf_collection=0,power_ctrl_lpar_ids=none,boot_mode=norm,lpar_keylock=norm,auto_start=0,redundant_err_path_reporting=0,rmc_state=none,time_ref=0,lpar_avail_priority=127,desired_lpar_proc_compat_mode=default,curr_lpar_proc_compat_mode=POWER9_base,simplified_remote_restart_capable=0,sync_curr_profile=1,affinity_group_id=none,vtpm_enabled=0,migr_storage_vios_data_status=Collection Pending,migr_storage_vios_data_timestamp=unavailable,powervm_mgmt_capable=0,pend_secure_boot=0,curr_secure_boot=0
hscroot@myhmc:~> 

6. Delete a LPAR

hscroot@myhmc:~> rmsyscfg -r lpar -m system2 -n machine2
hscroot@myhmc:~> echo $?
0
hscroot@myhmc:~> 

Where -r is resource -m is name of system and -n is lpar name.

7. List the hardware adapters present in the system

hscroot@myhmc:~> lshwres -r io --rsubtype slot -m system1 -Funit_phys_loc:lpar_name:description:drc_name
U78C9.001.WZS0A4H:machinex:PCIe2 2-Port 10GbE Base-T Adapter:U78C9.001.WZS0A4H-P1-C7
U78C9.001.WZS0A4H:machinex:1 Gigabit Ethernet (UTP) 4 Port Adapter PCIE-4x/Short:U78C9.001.WZS0A4H-P1-C11
U78C9.001.WZS0A4H:machinex:Empty slot:U78C9.001.WZS0A4H-P1-C12
U78C9.001.WZS0A4H:machinex:PCIe3 x8 SAS RAID Internal Adapter 6Gb:U78C9.001.WZS0A4H-P1-C14
U78C9.001.WZS0A4H:null:PCIe3 Expansion Drawer Cable Card:U78C9.001.WZS0A4H-P1-C6
U78C9.001.WZS0A4H:machinex:Universal Serial Bus UHC Spec:U78C9.001.WZS0A4H-P1-T2
U78C9.001.WZS0A4H:machinex:Empty slot:U78C9.001.WZS0A4H-P1-C8
U78C9.001.WZS0A4H:machinex:1 Gigabit Ethernet (UTP) 4 Port Adapter PCIE-4x/Short:U78C9.001.WZS0A4H-P1-C9
U78C9.001.WZS0A4H:machinex:PCIe2 4-Port (10GbE SFP+ & 1GbE RJ45) Adapter:U78C9.001.WZS0A4H-P1-C10
U78C9.001.WZS0A4H:machinex:Empty slot:U78C9.001.WZS0A4H-P1-C15
U78C9.001.WZS0A4H:machinex:10GB FCoE PCIe Dual Port Adapter:U78C9.001.WZS0A4H-P1-C4
U78C9.001.WZS0A4H:null:PCIe3 Expansion Drawer Cable Card:U78C9.001.WZS0A4H-P1-C5
U78C9.001.WZS0A4H:machinex:Empty slot:U78C9.001.WZS0A4H-P1-C2
U78C9.001.WZS0A4H:machinex:8 Gigabit PCI Express Dual Port Fibre Channel Adapter:U78C9.001.WZS0A4H-P1-C3
hscroot@myhmc:~> 


List the wwpn of Fibre Channel adapter

hscroot@myhmc:~> lshwres -r io -m system2 --rsubtype slotchildren -F phys_loc,description,wwpn,lpar_name | grep vios2
U78D4.ND1.CSS17HH-P1-C4-T1,8 Gigabit PCI-E Dual Port Fibre Channel Adapter,10000000c9995172,vios2
U78D4.ND1.CSS17HH-P1-C4-T2,8 Gigabit PCI-E Dual Port Fibre Channel Adapter,10000000c9995173,vios2
hscroot@myhmc:~> 

Note : The command will only list the WWPN if Power System is Powered on with Hardware Discovery Mode else normal power on will not display the WWPN

8. List the HMC version

List the hmc version, build level, serial number, model and ip address

hscroot@myhmc:~> lshmc -V
"version= Version: 9
 Release: 1
 Service Pack: 930
HMC Build level 2004020600
UNASSIGNED - PTF mapping is unassigned.  Please specify in src/data/ptfMapping.json
","base_version=V9R1
"
hscroot@myhmc:~> 
hscroot@myhmc:~> lshmc -v
"vpd=*FC ????????
*VC 20.0
*N2 Mon Apr 13 12:57:45 UTC 2013
*FC ????????
*DS Hardware Management Console
*TM V2d7-f3e
*SE 2b74c51
*MN IBM
*PN N/A
*SZ 990112186368
*OS Embedded Operating Systems
*NA 9.x.x.x1
*FC ????????
*DS Platform Firmware
*RM V9R1.930.0
*UVMID 2d7f:3e2b:7c27:4c51
"
hscroot@myhmc:~>