User Tools

Site Tools


aix:hmc_cmd

HMC commands

Reset connection to a host on the HMC

Clear the connection history if you want to remove and add again a managed system:

hmc@hscroot > mksysconn -o auto

2. Server type, make and serial number do not update, vterm sessions fail to open. Ensure you know the BMC admin password (Login to ASM). Remove the connection:

# rmsysconn -m <server name as shown in lssysconn -r all> -o r

Add the connection back. If the connection is DHCP private network:

# mksysconn -o auto

Wait a few minutes, re-enter the password when prompted. If the connection is static:

# mksysconn --ip <bmc ip> -u admin --passwd <admin password>

Wait several minutes for the VMI IP address to be discovered.

3. System toggles from “Pending Authentication” to “No connection” and showing Password expired 0806-0000-00000000. This is because the default user ID is admin and the default password is admin (the password is set to expired). Set the ID and password that your HMC will use to authenticate and manage the system. This is the same ID and password that you will use to access the ASMI. To set the system password, select the BMC, then select Actions > Update System Password. Helpful commands

The lssysconn command will list both the eBMC and VMI IP addresses and connection states. Each server must have a valid IP address for both. The VMI address must show connected when the server is standby or operating.

# lssysconn -r all
resource_type=sys,type_model_serial_num=9105-42A*13BEA00,sp_type=ebmc,ipaddr=192.168.128.215,user_name=admin,alt_ipaddr=unavailable,state=Connected,vmi_ipaddr=192.168.128.216,vmi_state=Connected

To check the vmi configuration:

# lssysconn -r vmi -m <server name>
resource_type=vmi,type_model_serial_num=9105-42A*13BEA00,interface=eth1,ipv4addr=10.254.0.33,gateway=0.0.0.0,net_mask=255.255.255.0,ipv4addr_orig=dhcp
resource_type=vmi,type_model_serial_num=9105-42A*13BEA00,interface=eth0,ipv4addr=9.1.1.9,gateway=9.1.1.1,net_mask=255.255.255.0,ipv4addr_orig=dhcp

To check for configuration errors:

lssyscfg -r sys -F name,state,state_detail

list UAK (update access key) on Power 8 and later

You have a firmware expiration date, it me be renew in case of expired

hmc@hscroot > lslic -m 9119-MME*??????? -F mtms,update_access_key_exp_date
9119-MME*???????,04/01/2019

You can enable an automatic renewal, go to Service ManagementTransmit Service Information and select Update Access Key Information with some interval.

Basic command for HMC

Open a virtual terminal on a LPAR/VIOS

Open a terminal on a host using command line:

You can either use vtmenu easy to use, just select then the server and then the LPAR

Or

 mkvterm -m managed-system
        {-p partition-name | --id partition-ID} [--help]

 Open a virtual terminal session for the partition with an ID of 1:

       mkvterm -m 9406-570*12345678 --id 1
       
       Exit the Vterm using ~~.  or  ~.

List commands

Power servers connected to the HMC

To get the names of server(s) managed by an HMC:

hscroot@sfohmc1:~> lssyscfg -r sys -F name
Server-9133-55A-SN062EEBH
Server-9406-MMA-SN103A7C0
Server-8233-E8B-SN0623B7P

To list LPAR names and LPAR profile names:

hscroot@sfohmc1:~> lssyscfg -r prof -m Server-8233-E8B-SN0623B7P --header -F lpar_name,name
lpar_name,name
06-23B7P,default_profile
vio1,default
vio2,default

Add/remove an adapter on LPAR/VIOS

Variable                                  Information needed:
$MACHINE_NAME              Server-9009-22A-SN8675309
$VIOS_NAME                        VIOS1
$LPAR_NAME                       nim01
$VIRTUAL_SLOT                  315
$REMOTE_SLOT                  315
$DEVICE TYPE                      fc (fibre), eth (ethernet), scsi (SCSI)
$ADD_OR_REMOVE            a (add), r (remove)
$SERVER_OR_CLIENT        server (Adding on VIOS), client (Adding on LPAR)

List virtual slot type fc

hscroot@sfohmc1:~> lshwres -r virtualio --rsubtype fc --level lpar -m Server-8233-E8B-SN0623B7P
lpar_name=vio1,lpar_id=2,slot_num=31,adapter_type=server,state=1,is_required=0,remote_lpar_id=4,remote_lpar_name=lpar1,remote_slot_num=21
lpar_name=vio1,lpar_id=2,slot_num=32,adapter_type=server,state=1,is_required=0,remote_lpar_id=5,remote_lpar_name=lpar2,remote_slot_num=21
lpar_name=vio1,lpar_id=2,slot_num=33,adapter_type=server,state=1,is_required=0,remote_lpar_id=6,remote_lpar_name=lpar3,remote_slot_num=21
lpar_name=vio1,lpar_id=2,slot_num=34,adapter_type=server,state=1,is_required=0,remote_lpar_id=7,remote_lpar_name=lpar4,remote_slot_num=21
lpar_name=vio2,lpar_id=3,slot_num=31,adapter_type=server,state=1,is_required=0,remote_lpar_id=4,remote_lpar_name=lpar1,remote_slot_num=22
lpar_name=vio2,lpar_id=3,slot_num=32,adapter_type=server,state=1,is_required=0,remote_lpar_id=5,remote_lpar_name=lpar2,remote_slot_num=22
lpar_name=vio2,lpar_id=3,slot_num=33,adapter_type=server,state=1,is_required=0,remote_lpar_id=6,remote_lpar_name=lpar3,remote_slot_num=22
lpar_name=vio2,lpar_id=3,slot_num=34,adapter_type=server,state=1,is_required=0,remote_lpar_id=7,remote_lpar_name=lpar4,remote_slot_num=22
lpar_name=lpar1,lpar_id=4,slot_num=21,adapter_type=client,state=1,is_required=0,remote_lpar_id=2,remote_lpar_name=vio1,remote_slot_num=31,"wwpns=c0507602f66f0000,c0507602f66f0001"
lpar_name=lpar1,lpar_id=4,slot_num=22,adapter_type=client,state=1,is_required=0,remote_lpar_id=3,remote_lpar_name=vio2,remote_slot_num=31,"wwpns=c0507602f66f0002,c0507602f66f0003"

Adding a virtual fibre channel device to an LPAR:

# chhwres -r virtualio -m $MACHINE_NAME -o $ADD_OR_REMOVE -p $VIOS_NAME --rsubtype $DEVICE TYPE -s $VIRTUAL_SLOT -a "adapter_type=$SERVER_OR_CLIENT,remote_lpar_name=$LPAR_NAME,remote_slot_num=$REMOTE_SLOT"
 
# chhwres -r virtualio -m Server-9009-22A-SN8675309 -o a -p VIOS1 --rsubtype fc -s 315 -a "adapter_type=client,remote_lpar_name=nim01,remote_slot_num=315"

Adding a virtual fibre channel device to a VIO:

# chhwres -r virtualio -m $MACHINE_NAME -o $ADD_OR_REMOVE -p $VIOS_NAME --rsubtype $DEVICE TYPE -s $VIRTUAL_SLOT -a "adapter_type=$SERVER_OR_CLIENT,remote_lpar_name=$LPAR_NAME,remote_slot_num=$REMOTE_SLOT"
 
# chhwres -r virtualio -m Server-9009-22A-SN8675309 -o a -p VIOS1 --rsubtype fc -s 315 -a "adapter_type=server,remote_lpar_name=nim01,remote_slot_num=315"

Removing a virtual adapter in slot 315 from an LPAR or VIOS:

# chhwres -r virtualio -m $MACHINE_NAME -o $ADD_OR_REMOVE -p $LPAR_NAME -s $VIRTUAL_SLOT
 
# chhwres -r virtualio -m Server-9009-22A-SN8675309 -o r -p nim01 -s 315

Now save the runing config (it overwrites profile with actual running config)

# mksyscfg -r prof -m <MAN_SYS> -o save -p <LPAR_NAME> -n <PROFILE_NAME> --force      

Removing a virtual adapter in slot 31 from an VIOS:

# chhwres -r virtualio -m $MACHINE_NAME -o $ADD_OR_REMOVE -p $LPAR_NAME -s $VIRTUAL_SLOT
 
# chhwres -r virtualio -m Server-9009-22A-SN8675309 -o r -p vios01 -s 31

Now save the runing config (it overwrites profile with actual running config)

# mksyscfg -r prof -m Server-9009-22A-SN8675309 -o save -p vios01 -n vios --force      

Same into the profile of the VIOS (static applies only after profile is applied, when LPAR restart)

# chsyscfg -r prof -m lab-01-p740 -i 'name=vios,lpar_id=1,"virtual_fc_adapters+=""34/server/6//14//1"""'
                For the LPAR
                               (Same into the profile of the LPAR)
chsyscfg -r prof -m lab-01-p740 -i 'name=default_profile,lpar_id=6,"virtual_fc_adapters+=""14/client/1/LABVIO01/34//1"""'
                               (Si besoin, DLPAR vfc "client" on labaix01 slot 14, from source LABVIO01 slot 34)
#chhwres -r virtualio -m lab-01-p740 -o a -s 14 -p labaix01 --rsubtype fc -a "adapter_type=client,remote_lpar_name=LABVIO01,remote_slot_num=34"                                             

List commands

hscroot@sfohmc1:~> lshwres -r virtualio --rsubtype fc --level lpar -m Server-8233-E8B-SN0623B7P -F lpar_name,wwpns --header --filter lpar_names=lpar2
lpar_name,wwpns
lpar2,"c0507602f66f0004,c0507602f66f0005"
lpar2,"c0507602f66f0006,c0507602f66f0007"
cybroot@sfohmc1:~>


hscroot@sfohmc1:~> lshwres -r virtualio --rsubtype fc --level lpar -m Server-8233-E8B-SN0623B7P
lpar_name=vio1,lpar_id=2,slot_num=31,adapter_type=server,state=1,is_required=0,remote_lpar_id=4,remote_lpar_name=lpar1,remote_slot_num=21
lpar_name=vio1,lpar_id=2,slot_num=32,adapter_type=server,state=1,is_required=0,remote_lpar_id=5,remote_lpar_name=lpar2,remote_slot_num=21
lpar_name=vio1,lpar_id=2,slot_num=33,adapter_type=server,state=1,is_required=0,remote_lpar_id=6,remote_lpar_name=lpar3,remote_slot_num=21
lpar_name=vio1,lpar_id=2,slot_num=34,adapter_type=server,state=1,is_required=0,remote_lpar_id=7,remote_lpar_name=lpar4,remote_slot_num=21
lpar_name=vio2,lpar_id=3,slot_num=31,adapter_type=server,state=1,is_required=0,remote_lpar_id=4,remote_lpar_name=lpar1,remote_slot_num=22
lpar_name=vio2,lpar_id=3,slot_num=32,adapter_type=server,state=1,is_required=0,remote_lpar_id=5,remote_lpar_name=lpar2,remote_slot_num=22
lpar_name=vio2,lpar_id=3,slot_num=33,adapter_type=server,state=1,is_required=0,remote_lpar_id=6,remote_lpar_name=lpar3,remote_slot_num=22
lpar_name=vio2,lpar_id=3,slot_num=34,adapter_type=server,state=1,is_required=0,remote_lpar_id=7,remote_lpar_name=lpar4,remote_slot_num=22
lpar_name=lpar1,lpar_id=4,slot_num=21,adapter_type=client,state=1,is_required=0,remote_lpar_id=2,remote_lpar_name=vio1,remote_slot_num=31,"wwpns=c0507602f66f0000,c0507602f66f0001"
lpar_name=lpar1,lpar_id=4,slot_num=22,adapter_type=client,state=1,is_required=0,remote_lpar_id=3,remote_lpar_name=vio2,remote_slot_num=31,"wwpns=c0507602f66f0002,c0507602f66f0003"
lpar_name=lpar2,lpar_id=5,slot_num=21,adapter_type=client,state=1,is_required=0,remote_lpar_id=2,remote_lpar_name=vio1,remote_slot_num=32,"wwpns=c0507602f66f0004,c0507602f66f0005"
lpar_name=lpar2,lpar_id=5,slot_num=22,adapter_type=client,state=1,is_required=0,remote_lpar_id=3,remote_lpar_name=vio2,remote_slot_num=32,"wwpns=c0507602f66f0006,c0507602f66f0007"

List difference between running profile and defined profiles: (lsyscfg: defined, lshwres: running config)

hscroot@hmc:~> lssyscfg -r prof -m P570-SERVER  --header -F lpar_name,name,max_virtual_slots
lpar_name,name,max_virtual_slots
vio1,normal,100
nim,normal,16
lpardev,normal,16
hscroot@hmc:~> lshwres -r virtualio --rsubtype slot --level lpar -m P570-SERVER -F lpar_name,curr_max_virtual_slots
vio1,100
nim,16
lpardev,10

HMC command line:
commands have –help option and man pages

lssyscfg -r sys -F name | grep aix21f04                       shows the full name of the managed system (what we can use in other commands)
lssyscfg -r lpar -m <managedsysname> -F name                  shows the full name of the lpars of the managed system
lssyscfg -r sys -m <managedsysname> -F name,state --header    shows the state of the managed system
lssyscfg -r lpar -m <managedsysname> -F name,state --header   shows the state of the lpars of the managed system
lssyscfg -r prof -m aix10c22-SN0603C6H --filter "lpar_names=aix10c22b" -F name,boot_mode    it will show the boot mode in the profile

lshwres -r mem -m <managedsysname> --level sys                shows memory information of the managed system
lshwres -r mem -m <managedsysname> --level lpar               shows memory information of lpars of the managed system
lshwres -r proc -m <managedsysname> --level sys               shows processor information of the managed system
lshwres -r proc -m <managedsysname> --level lpar              shows processor information of lpars of the manage system
lshwres -r io -m <managedsysname> --rsubtype slot             shows IO slot information
lshwres -r proc -m <managedsysname> --level sys -F installed_sys_proc_units:configurable_sys_proc_units

lshwres -r virtualio --rsubtype scsi -m <managedsysname> --level lpar               lists scsi devices by LPAR
lshwres -r virtualio --rsubtype eth -m <managedsysname> --level lpar                lists virt. eth. devices by LPAR
lshwres -r virtualio --rsubtype eth -m <managedsysname> --level lpar -F lpar_name,port_vlan_id

chsysstate -m <managedsysname> -o standby -r sys              power on a system to standby
chsysstate -r sys -m <managedsysname> -o off                  normal power off the managed system
chsysstate -r sys -m <managedsysname> -o off --immed          fast power off the managed system

chsysstate -m <managed system> -r lpar -n <lparname> -o shutdown --restart          it will reboot an lpar with dump
chsysstate -m <managed system> -r lpar -n <lparname> -o shutdown --immed --restart  it will reboot an lpar immediately (without dump)
chsysstate -m <managedsysname> -r lpar -n <lparname> -o shutdown --immed            it will shutdown the oprating system
chsysstate -m aix10c22-SN65158BE -o on -r lpar -n aix10c22b -f default              it will activate an lpar

lspartition -dlpar                                            shows dlpar capable partitions
                                                              (it will show if RMC connection is OK between the HMC and LPAR)

lssysconn -r all                                              to see what IPs are assigned by the HMC
mksysconn -o auto                                             tells HMC to re-discover all servers' IP address

lssvcevents -t console -d 60                                  lists console events in the past 60 days
lssvcevents -t hardware -d 0                                  list serviceable events which occured today

lshmc -V                                                      hmc version
lshmc -v                                                      hmc model
lshmc -n                                                      lists the network settings of the hmc
hmcshutdown -t now -r                                         reboot the HMC (-t: timing in minutes, -r: reboot)

vtmenu                                                        hmc menu options (console session can be opened as well)
logout: ~~. (2 tilde and a dot)

------------------------------------

Default root password: passw0rd (try su -)

------------------------------------

opening/closing virtual terminal from hmc:

lssyscfg -r sys -F name                         <--get managed system name
lssyscfg -r lpar -m <managed system> -F name    <--get lpar name

mkvterm -m <managed system> -p <lpar>           <--opens a terminal window
rmvterm -m <managed system> -p <lpar>           <--closes a terminal window

~~.                                             <--logout from te session (not necessary to leave AIX)

Create a new virtual switch (use “r” to remove)

hscroot@hmc:~> chhwres -r virtualio -m p824-1234 -o a --rsubtype vswitch --vswitch net_production

Create an LPAR and specify a WWPN

hscroot@hmc:~> mksyscfg -m SERVER -r lpar -i ‘name=LPARname,profile_name=Profilename,lpar_id=10,lpar_env=os400,min_mem=1024,desired_mem=2048,max_mem=2048,mem_mode=ded,proc_mode=shared,min_proc_units=0.05,desired_proc_units=0.1,max_proc_units=2.0,min_procs=1,desired_procs=1,max_procs=2,sharing_mode=uncap,uncap_weight=128,shared_proc_pool_id=1,max_virtual_slots=10,“virtual_eth_adapters=2/0/70//0/0/Ethernet0//all/none”, “virtual_fc_adapters=””2/client/17/VIOS1/11/c050760828120001,c050760828120002/1″”,“”3/client/17/VIOS1/12/c050760828120003,c050760828120004/0″”,“”4/client/18/VIOS2/11/c050760828120005,c050760828120006/1″””, console_slot=hmc’

mksyscfg -r lpar -m system1 -i "name=aix_lpar2,
        profile_name=prof1,lpar_env=aixlinux,min_mem=256,
        desired_mem=1024,max_mem=1024,proc_mode=ded,
        min_procs=1,desired_procs=1,max_procs=2,allow_perf_collection=1,
        sharing_mode=share_idle_procs,auto_start=1,sync_curr_profile=1,
        boot_mode=norm,lpar_io_pool_ids=3,
        "io_slots=21010003/3/1,21030003//0""

VIOS command through the HMC (use RMC)

[root@labaixna201] /root> command=$(printf "lsdev "); ssh hscroot@labibmha001 viosvrcmd -m cpk-90-p710-lab -p LABVIOA001 -c "$command" | grep '^fcs' | awk '{print $1}'
fcs0
fcs1

Advanced command for HMC

Set/unset service partition

List which partition is assigned as service

# lssyscfg -r sys -F name
# lssyscfg -r sys -m <Managed_System_Name> -F name,service_lpar_id,service_lpar_name
Output would be as follows:
name,service_lpar_id,service_lpar_name
<Managed_System_Name>,1,<Service_Partition_Name>

Change or remove the service partition: use partition ID or none

# chsyscfg -r sys -m <Managed_System_Name> -i "service_lpar_id=none"

Manually upgrade Power firmware

command to perform the update using the disk staging area. - Create your firmware update directory within users $HOME

mkdir fw_update

- Copy the firmware update files from remote server using scp

scp /my_firmware_repository_dir/* user@hmc:/home/<user>/fw_update

Note: If you are sending the files from your workstation to the HMC and application. If using windows, WinSCP is a very nice open source app to use for doing the scp over to the HMC and its got a graphically file manager interface that is intuitive.

Example of using updlic command to install firmware

- Use the updlic command to install the firmware

updlic -m <system name> -o a -t sys -l latest -r mountpoint -d /home/<user>/fw_update

You can find the system name to use in above command by running

lssyscfg -r sys -F name

If the system name was MySystem-570 and the user was hscroot the uplic command would look like the following.

updlic -m MySystem-570 -o a -t sys -l latest -r mountpoint -d /home/hscroot/fw_update Make sure you have copied all appropriate files (RPM, XML, etc) related to the firmware update prior to running the updlic command.

LPM (Partition mobility)

shows how many concurrent migrations are possible (num_active_migr._supported)

lslparmigr -r sys -m <system>                        

list status of lpars (lpar_id will be shown as well)

lslparmigr -r lpar -m source_sys

validation of lpar (id) for migration

migrlpar -o v -t dest_sys -m source_sys --id 1         
echo $?                                          if return code is 0, validation was successful

migrating lpar

migrlpar -o m -t dest_sys -m source_sys -p lpar1 &   

show state

lssyscfg -r lpar -m source_sys -F name,state           

Show migration state

lslparmigr -r lpar -m source_sys -F name,migration_state,bytes_transmitted,bytes_remaining

Backup HMC data

hscroot@hmcsrvr:~> bkconsdata -r ftp -h hostname -u user --passwd pass -d /home/user/

User management

Create or list a user:

hscroot@hmc:~> lshmcusr 
name=root,taskrole=hmcsuperadmin,description=root,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=sha512,disabled=0
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=sha512,disabled=0
hscroot@hmc:~> mkhmcusr -u admin -a hmcsuperadmin --passwd abc1234

How to change the HMC password (of user hscroot)

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

Remove restricted shell for hscroot user (needs to boot on a linux live CD with Knoppix or Gparted):

cd /opt/hsc/data/ssh/
chmod 755 hmcsshrc
vi hmcsshrc
Add # before "set -r"

Manage HMC disk space

Check space on HMC:

hscroot@hmc1:~> monhmc -r disk -n 0
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             16121184   6467024   8835248  43% /
tmpfs                  1031944       136   1031808   1% /dev
tmpfs                  1031944         0   1031944   0% /dev/shm
/dev/sda3              6040320   2951240   2782240  52% /var
/dev/sda7              8056524    159336   7487936   3% /dump
/dev/sda8            126833720    192216 120198636   1% /extra

hscroot@hmc1:~> monhmc -r disk -n 0
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             16121184   7277296   8024976  48% /
tmpfs                  1031924       156   1031768   1% /dev
tmpfs                  1031924         0   1031924   0% /dev/shm
/dev/sda3              6040320    327112   5406368   6% /var
/dev/dm-1             10321208    227212   9569708   3% /home
/dev/dm-3              6192704    329100   5549032   6% /var/hsc/log
/dev/dm-0             30963708    177776  29213068   1% /dump
/dev/dm-2             20642428    176088  19417764   1% /extra
/dev/dm-5             41284928    183784  39003992   1% /data

Estimate the space you can freed:

hscroot@hmc1:~> lshmcfs -o c -d 0
filesystem=/var,filesystem_size=5898,filesystem_avail=4388,"temp_files_start_time=Jun 6, 2013 4:56:00 PM",temp_files_size=542,to_be_freed=1695
filesystem=/dump,filesystem_size=7867,filesystem_avail=7316,"temp_files_start_time=Sep 19, 2013 7:35:00 AM",temp_files_size=0,to_be_freed=4
filesystem=/extra,filesystem_size=123861,filesystem_avail=117381,temp_files_start_time=none,temp_files_size=0,to_be_freed=0
filesystem=/,filesystem_size=15743,filesystem_avail=8628,temp_files_start_time=none,temp_files_size=0,to_be_freed=0

Clean up:

hscroot@hmc1:~> chhmcfs -o f -d 0

Now you use less space:

hscroot@hmc1:~> lshmcfs -o c -d 0
filesystem=/var,filesystem_size=5898,filesystem_avail=4390,"temp_files_start_time=Jun 6, 2013 4:56:00 PM",temp_files_size=544,to_be_freed=0
filesystem=/dump,filesystem_size=7867,filesystem_avail=7317,"temp_files_start_time=Sep 19, 2013 7:35:00 AM",temp_files_size=0,to_be_freed=0
...
hscroot@hmc1:~> monhmc -r disk -n 0
Filesystem           1K-blocks      Used Available Use% Mounted on
...
/dev/sda3              6040320   1246296   4487184  22% /var
monhmc -r mem -n 0                                            shows total, used and free mamory of HMC
monhmc -r disk -n 0                                           shows filesystems and usage info (same as "df -k")
monhmc -r proc -n 0                                           shows cpu usage of each processor
monhmc -r swap -n 0                                           shows paging space usage

Managed system and LPAR related commands:

commands have –help option and man pages

lssyscfg -r sys -F name | grep aix21                          shows the full name of the managed system (what we can use in other commands)
lssyscfg -r lpar -m <managedsysname> -F name                  shows the full name of the lpars of the managed system
lssyscfg -r sys -m <managedsysname> -F name,state --header    shows the state of the managed system
lssyscfg -r lpar -m <managedsysname> -F name,state --header   shows the state of the lpars of the managed system
lssyscfg -r prof -m aix10-SN0603C6H --filter "lpar_names=aix10" -F name,boot_mode   it will show the boot mode in the profile
lssyscfg -r prof -m <man.sys> -F lpar_name,virtual_eth_adapters                     shows LPARS with ethernet adaptesr and VLAN tags
lshwres -r mem -m <managedsysname> --level sys                shows memory information of the managed system
lshwres -r mem -m <managedsysname> --level lpar               shows memory information of lpars of the managed system
lshwres -r proc -m <managedsysname> --level sys               shows processor information of the managed system
lshwres -r proc -m <managedsysname> --level lpar              shows processor information of lpars of the manage system
lshwres -r io -m <managedsysname> --rsubtype slot             shows IO slot information
lshwres -r proc -m <managedsysname> --level sys -F installed_sys_proc_units:configurable_sys_proc_units

lshwres -r virtualio --rsubtype scsi -m <managedsysname> --level lpar               lists scsi devices by LPAR
lshwres -r virtualio --rsubtype eth -m <managedsysname> --level lpar                lists virt. eth. devices by LPAR
lshwres -r virtualio --rsubtype eth -m <managedsysname> --level lpar -F lpar_name,port_vlan_id

Check RMC state

lssyscfg -r lpar -m <managedsysname> -F lpar_id,state, rmc_state,rmc_ipaddr,os_version,dlpar_mem_capable,dlpar_proc_capable,dlpar_io_capable 
chsysstate -m <managedsysname> -o standby -r sys              power on a system to standby
chsysstate -r sys -m <managedsysname> -o off                  normal power off the managed system
chsysstate -r sys -m <managedsysname> -o off --immed          fast power off the managed system

chsysstate -m <managed system> -r lpar -n <lparname> -o shutdown --restart          it will reboot an lpar with dump
chsysstate -m <managed system> -r lpar -n <lparname> -o shutdown --immed --restart  it will reboot an lpar immediately (without dump)
chsysstate -m <managedsysname> -r lpar -n <lparname> -o shutdown --immed            it will shutdown the oprating system
chsysstate -m aix10-SN65158BE -o on -r lpar -n aix10 -f default                     it will activate an lpar
mksyscfg -r prof -m <MAN_SYS> -o save -p <LPAR_NAME> -n <PROFILE_NAME> --force      it overwrites profile with actual running config
lspartition -dlpar                                            shows dlpar capable partitions
                                                              (it will show if RMC connection is OK between the HMC and LPAR)
lssysconn -r all                                              to see what IPs are assigned by the HMC
mksysconn -o auto                                             tells HMC to re-discover all servers' IP address
lssvcevents -t console -d 60                                  lists console events in the past 60 days
lssvcevents -t hardware -d 0                                  list serviceable events which occured today
lssvcevents -t console -d 300 | grep DLPAR                    list DLPAR operations of last 300 days (you can grep more to mem or proc)
lssvcevents -t console -d 7 | grep Migration                  list last 7 days LPMs
lshmc -V                                                      hmc version
lshmc -v                                                      hmc model
lshmc -n                                                      lists the network settings of the hmc
hmcshutdown -t now -r                                         reboot the HMC (-t: timing in minutes, -r: reboot)
vtmenu                                                        hmc menu options (console session can be opened as well)
logout: ~~. (2 tilde and a dot)
lslparmigr -r sys -m <managed system> | sed "s/,/\n/g"        shows how many concurrent migr. is possible

ssh hscroot@hmcXX 'for i in `lssyscfg -r sys -F name`;do echo $i;lssyscfg -r lpar -m $i -F name|grep <LPARNAME>;echo;done' <--shows man. system of given LPAR via ssh
for i in `lssyscfg -r sys -F name`;do lssyscfg -r prof -m $i -F lpar_name,virtual_eth_adapters | grep vio | grep <VLAN>;echo; done <--shows spec. VLAN

for sys in `lssyscfg -r sys -F name`; do for vio in `lssyscfg -r lpar -m $sys -F name,lpar_env | grep vioserver | cut -f 1 -d, | sort`; do echo $vio; viosvrcmd -m $sys -p $vio -c <VIO COMMAND>; done; done <--runs a command on VIOS servers
------------------------------------

Default root password: passw0rd (try su -)

------------------------------------

opening/closing virtual terminal from hmc:

lssyscfg -r sys -F name                         <--get managed system name
lssyscfg -r lpar -m <managed system> -F name    <--get lpar name

mkvterm -m <managed system> -p <lpar>           <--opens a terminal window
rmvterm -m <managed system> -p <lpar>           <--closes a terminal window

~~.                                             <--logout from te session (not necessary to leave AIX)

Adding/removing VLAN TAG dynamically: (it will not add to profile)

adding:

chhwres -r virtualio --rsubtype eth -m <man.sys.> -o s -p <LPAR> -s <adapter id> -a "addl_vlan_ids+=<VLAN TAG>"

removing:

chhwres -r virtualio --rsubtype eth -m <man.sys.> -o s -p <LPAR> -s <adapter id> -a "addl_vlan_ids-=<VLAN TAG>"

Changing LPAR weight:

lshwres -r proc -m <MAN_SYS> --level lpar --filter lpar_names=<LPAR_NAME>                            list actual running config
chhwres -r proc -m <MAN_SYS> -p <LPAR_NAME> -o s -a "uncap_weight=32"                                changes weight of actual running config

lssyscfg -r prof -m <MAN_SYS> --filter lpar_names=<LPAR_NAME>                                        list profile
chsyscfg -r prof -m <MAN_SYS> -i "name=<PROFILE_NAME>,lpar_name=<LPAR_NAME>,uncap_weight=32"         changes weight in given profile
chsyscfg -r lpar -m <managed_system> -o apply -p <lpar_name> -n <profile_name>

Changing simplified restart capability, to change it we currently need to change it during LPAR poweroff:

hscroot@hmc:~> lssyscfg -m p812-srv1 -r lpar --filter "lpar_names=lparlab" -F simplified_remote_restart_capable
0
hscroot@hmc:~> chsyscfg -m p812-srv1 -r lpar -i "name=lparlab,simplified_remote_restart_capable=1"
An error occurred while changing the partition named lparlab.
HSCLA9F8 The remote restart capability of the partition can only be changed when the partition is shutdown.

=⇒ LPAR propertie: Remote Restartable (Simplified): Activated

Now you are able to start the LPAR once poweroff directly on another server Restart LPAR only if poweroff

hscroot@hmc:~> rrstartlpar -o restart -m 'p812-srv1' -p lparlab -t p812-srv2

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@hmc$ 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@hmc:~> lspartition -dlpar
<#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@hmc$ mksysconn -o auto

How to list 3 days of console events:

hscroot@hmc$ lssvcevents -t console -d 3

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

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

How to list 3 days of hardware events:

hscroot@hmc$ lssvcevents -t hardware -d 3

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

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

How to do HMC restart:

hscroot@hmc$ hmcshutdown -r -t0

How to list HMC version:

hscroot@hmc$ lshmc -V

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

hscroot@hmc$ lshmc -v

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

hscroot@hmc$ lssyscfg -r sys -F name

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

hscroot@hmc:~> 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@hmc$ lssyscfg -m FRAME -r lpar -F name,lpar_id,state,curr_profile

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

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

How to list total processors of the squadron:

hscroot@hmc$ 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@hmc$ 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@hmc$ lshwres -r mem -m FRAME --level lpar -F lpar_name,curr_mem

How to display vios from all squadrons:

hscroot@hmc$ 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@hmc$ 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@hmc$ chsysstate -m FRAME -r lpar -n PARTITION -o reset
power5: hscroot@hmc$ chsysstate -r lpar -m FRAME -o shutdown -n PARTITION

How to stop LPAR partition via HMC:

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

How to stop LPAR partition via HMC with dump:

hscroot@hmc$ 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@hmc$ 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@hmc$ mkvterm -m FRAME -p PARTITION

How to remove an existing terminal connection:

hscroot@hmc$ 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@hmc$ monhmc -r disk

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

hscroot@hmc$ chhmcfs -o f -d 0

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

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

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

hscroot@hmc$ bkprofdata -m FRAME -f dvd

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

hscroot@hmc$ 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@hmc:~> lssvcevents -t console -d 9999|grep 'Profile data'

HMC user, password policy

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

hscroot@hmc:~> 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@hmc:~> chpwdpolicy -o a -n gzadm

Change the password:

hscroot@hmc:~> chhmcusr -u gzadm -t passwd

Disable the policy:

hscroot@hmc:~> chpwdpolicy -o d

Remove the policy:

hscroot@hmc:~> rmpwdpolicy -n gzadm

How to list user's settings:

NOTE: these values are all changeable via chhmcusr command.

hscroot@hmc:~ 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@hmc:~> 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.

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

hscroot@hmc:~> chhwres -r proc -m FRAME -o r --id 6 --procunits 0.6
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

Clone LPAR config from HMC/IVM

To generate a “mksyscfg” command line from a single LPAR, run the following command on the HMC (this should all be on 1 long line). Change the highlighted yellow parts with the name of the LPAR and the managed system name:

    lpar=aix1; system=p520; printf "##Command to create $lpar ($system)\nmksyscfg -r lpar -m $system -i \""; lssyscfg -r prof -m $system --filter "lpar_names=$lpar,profile_names=`lssyscfg -r lpar -m $system --filter "lpar_names=$lpar" -F default_profile`" | sed  -e 's/\(^\|,\)name=/profile_name=/' -e 's/,lpar_name=/,name=/' -e 's/"/\\"/g' -e 's/$/"/'; printf "#\n#\n"
lssyscfg -r prof -m P7C3 --filter lpar_names=$NAME -F lpar_env,virtual_fc_adapters | \
	tr -s ',' '\n' | perl -lne 'print $1 if m%\w+vios\d+/(\d+)/%' | sort -n | head -1)
ADAP2=$((ADAP1+1))
echo "Adapter: $ADAP1 $ADAP2"
echo

# VIOS config hmc command # Create vfc server 1 on vios1 CMD=$( cat«EOF chhwres -r virtualio -m $MACHINE -o a -p ${VIOS}1 –rsubtype fc -s $ADAP1 -a “adapter_type=server,remote_slot_num=6,remote_lpar_name=$NAME” EOF

List adapter on VIOS:

lssyscfg -r prof -m p710 --filter lpar_names=VIOS03 -F lpar_env,virtual_fc_adapters,virtual_scsi_adapters
vioserver,"21/server/11/NIM01/5//1,31/server/11/NIM01/6//1",11/server/11/NIM01/4/1

http://www-01.ibm.com/support/docview.wss?uid=isg3T1011788

The command to create a vscsi pair is:

$ chhwres -r virtualio --rsubtype scsi -o a -s 5 --id 2

detail:

$ chhwres -r virtualio --rsubtype scsi -o a<add> -s<slot> 5 --id<lpar> 2

The command to remove or delete a vscsi pair is:

$ chhwres -r virtualio --rsubtype scsi -o r -s 5 --id 2

detail:

$ chhwres -r virtualio --rsubtype scsi -o r<remove> -s<slot> 5 --id<lpar> 2 
chhwres -r virtualio -m $MACHINE -o a -p ${VIOS}1 --rsubtype fc -s $ADAP1 -a "adapter_type=server,remote_slot_num=6,remote_lpar_name=$NAME"

EOF

https://www.ibm.com/developerworks/community/blogs/brian/entry/cloning_lpar_configurations_to_save_time_and_for_disaster_recovery12?lang=en

hscroot@hmc01:~> lssyscfg -r prof -m P710 --filter lpar_names=NIM01
name=normal,lpar_name=NIM01,lpar_id=11,lpar_env=aixlinux,all_resources=0,min_mem=4096,desired_mem=4096,max_mem=8192,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.2,max_proc_units=2.0,min_procs=1,desired_procs=2,max_procs=2,sharing_mode=uncap,uncap_weight=128,shared_proc_pool_id=0,shared_proc_pool_name=DefaultPool,affinity_group_id=none,io_slots=none,lpar_io_pool_ids=none,max_virtual_slots=20,"virtual_serial_adapters=0/server/1/any//any/1,1/server/1/any//any/1",virtual_scsi_adapters=4/client/3/VIOS03/11/1,"virtual_eth_adapters=2/0/2//0/1/ETHERNET0//all/none,3/0/2//0/1/ETHERNET0//all/none",virtual_eth_vsi_profiles=none,vtpm_adapters=none,"virtual_fc_adapters=""5/client/3/VIOS03/21/c050760522210000,c050760522210001/1"",""6/client/3/VIOS03/31/c050760522210002,c050760522210003/1""",hca_adapters=none,boot_mode=norm,conn_monitoring=0,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,redundant_err_path_reporting=0,bsr_arrays=0,lhea_logical_ports=none,lhea_capabilities=none,lpar_proc_compat_mode=default,electronic_err_reporting=null

Configure Kerberos

hscroot@hmc01:~> chhmc -c kerberos -s remove –realm <kerberos_hostname> -a <kerberos_ip>
hscroot@hmc01:~> chhmc -c kerberos -s add --realm <kerberos_hostname> -a <kerberos_ip>

Led management

Turn off / on a LED on a server

hscroot@hmc01:~> lssyscfg -r sys -F name
Power10_01_siteA

Check to see if the attention LED is active

hscroot@hmc01:~> lsled -r sa -t phys -m Power10_01_siteA
state=on

Use the chled command to turn off the system attention LED

hscroot@hmc01:~> chled -r sa -t phys -m Power10_01_siteA -o off

To check the status of system attention LED you can use the lsled

hscroot@hmc01:~> lsled -r sa -t phys -m Power10_01_siteA 
state=off

On partitions:

hscroot@hmc01:~> lsled -r sa -t virtuallpar -m Power10_01_siteA 
lpar_id=22,lpar_name=AIXA001,state=off
lpar_id=17,lpar_name=AIXA002,state=off
lpar_id=13,lpar_name=AIXA003,state=off
aix/hmc_cmd.txt · Last modified: 2024/03/29 11:49 by manu