dropdown menu

HMC - CLI

HMC command line:

The 2 mostly used commands to gather info about managed systems and lpars:

lssyscfg: info about managed system, lpar (i.e. running or not) or profile configuration
lshwres: info about the resources (cpu/mem/vscsi..) of a managed system or lpar

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

lssyscfg

Lists managed-systems, partitions, partition profiles and attibutes of them. When you give resource type you can choose from: sys, lpar or prof.

If sys or lpar has been chosen it does not list resources like cpu/mem settings or vscsi/vfc adapter config, only general info about the system/lpar, like lpar is activated or not, what is the cpu mode, or rmc state...

If prof is chosen, it lists cpu,mem,vscsi... config from the lpar profile. (lshwres command shows these data from the running partition, not from the profile.)


lssyscfg -m <sys> -r <res> --filter "<name>=<value>,<value>" -F <attr>,<attr> --header

-m name of the managed system (if omitted all managed systems will be listed)

-r resource type
     sys gives general indo about managed system
     lpar gives general info about lpar
     prof gives specific infos (cpu, mem, vscsi..) from the lpar profile

--filter select values for a specific resource only (lpar_ids, lpar_names and profile_names)
   "lpar_ids=...,..."
   "lpar_names=...,."
   "profile_names=.."

-F display only the given attributes (name of the attr. will not be displayed and delimeter can be specified)

--header show header of the displayed values

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

lssyscfg -r sys -F name lists name of managed systems (this name can be used in other commands)

lssyscfg -m <sys> -r lpar lists general info of lpars on the managed sys.
lssyscfg -m <sys> -r prof lists all settings in the lpar profiles on the managed sys.

other example:
lssyscfg -m <sys> -r lpar -F name,state --header                                  lists lpars and if it is activated or not
lssyscfg -m <sys> -r prof -F lpar_name,virtual_eth_adapters                        lists lpars with eth. adapters (vlan tags will be shown as well)
lssyscfg -m <sys> -r prof --filter "lpar_names=<lpar>" -F name,virtual_fc_adapters lists vfc adapters (with wwpn) of an lpar


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

lshwres:

Lists hardware resources of the managed-system and lpars, including physical I/O, virtual I/O, cpu/mem settings, (shared) processor pool, etc.

lshwres -m <sys> -r <res> --rsubtype <subtype> --level <lpar/sys> --filter "<name>=<value>,<value>" -F <attr>,<attr> --header

-m name of the managed system (lssyscfg -r sys -F name)

-r resource type
     io      physical io
     mem memory
     proc    processing unit
     virtualio virtual io

--rsubtype subtype of the resource given previously (it works for io and virualio)
     io       slot, slotchildresn (these can be used for the resource 'io')
     virtualio eth, fc, scsi, vswitch (these can be used for the resource 'virtualio')

--level      display info of managed system or lpar (it works for mem, proc and virtualio)
     lpar info is taken from lpar level (i.e memory values of the lpars)
     sys info is taken from system level (i.e memory value of the managed system)

--filter select values for a specific resource only (not all value can be used as filter)
   "lpar_ids=...,..."
   "lpar_names=...,."
   "vlans=...,...,.."

-F display given attributes (the name of the attribute will not be displayed and delimeter can be specified)

--header show header of the displayed values

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

Physical I/O (io):
lshwres -m <sys> -r io --rsubtype slot/slotchildren shows io slot information (or children devices of slots)


MEM/PROC (mem/proc):
lshwres -m <sys> -r mem/proc --level lpar/sys shows mem/proc info of all lpars or the managed system


VIRTUAL I/O (virtualio):
lshwres -m <sys> -r virtualio --rsubtype vswitch shows virtual switches with configured vlan ids on them
lshwres -m <sys> -r virtualio --rsubtype eth --level lpar   shows virt. ethernet adapters with lpar_name,slot_id, vlan_id....
lshwres -m <sys> -r virtualio --rsubtype fc --level lpar    shows virt. fc adapters with lpar_name,slot_id, wwpns...
lshwres -m <sys> -r virtualio --rsubtype scsi --level lpar shows vscsi adapters with lpar_name,slot_id...


SR-IOV (sriov):
lshwres -m <sys> -r sriov --rsubtype physport --level ethc lists physical port config: location, speed, mtu size ...
lshwres -m <sys> -r sriov --rsubtype logport --level eth   lists logical port config: capacity, mac address, vlans ...
chhwres -m <sys> -r sriov --rsubtype physport -o s -a “adapter_id=1,phys_port_id=1,conn_speed=10000”  change phys. port config


other example:
lshwres -m <sys> -r virtualio --rsubtype eth --level lpar --filter "lpar_names=<lpar>" -F slot_num:addl_vlan_ids  shows lpar virt. adapters and vlans

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

Other commands:

TAB-TAB          shows all commands available for the user (commands have --help option and man pages)

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

chsysstate -m <sys> -r lpar -n <lpar> -o shutdown --restart          it will reboot an lpar with dump
chsysstate -m <sys> -r lpar -n <lpar> -o shutdown --immed --restart  it will reboot an lpar immediately (without dump)
chsysstate -m <sys> -r lpar -n <lpar> -o shutdown --immed    it will shutdown the operating system
chsysstate -m <sys> -r lpar -n <lpar> -o on -f default               it will activate an lpar

migrlpar  perform partition migrations
lslparmigr  lists info about lpar migration
lslparmigr -m <sys> -r lpar                                       list lpars and migration state (not migrating or migrating..)
lslparmigr -r sys -m <managed system> | sed "s/,/\n/g"               shows how many concurrent migr. is possible

lsnportlogin -m sys> --filter "lpar_names=<lpar>"                    list all npiv (wwpn) info of an lpar
lsnportlogin -m sys> --filter "lpar_names=<lpar>" -F wwpn  lists only wwpn of given lpar

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

lssacfg -t email  shows email notification settings

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
lshmv -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)

lslogon -r webui -u  lists users logged in gui (lslogon -r webui -t <--lists running tasks)
lslogon -r ssh -u  lists users logged in cli (lslogon -r ssh -t <--lists running tasks)
termtask -r { webgui | ssh } -s (session) -t (task)  terminate a running task (or all tasks)

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

sendfile  transfer files with ftp from HMC to another server

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


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
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 i in `lssyscfg -r sys -F name` ; do echo $i; lssyscfg -r prof -m $i -F name,lpar_name --header; done  <--show all lpar profiles

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 errlog; done; done                     <--runs a command (here errlog) on VIOS servers
------------------------------------

Default root password: passw0rd (try su -)

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

/usr/samples/tcpip/anon.ftp

If you want to use remote FTP installs on HMC, an FTP user will be needed on the remote (AIX) server.
There is a default script on AIX which creates an ftp or anonymous user for this FTP connection: /usr/samples/tcpip/anon.ftp
This scripts should be used to create FTP user, otherwise connection will work but files won’t be reachable by HMC.

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

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 the 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


56 comments:

Dennis said...

Are there anymore HMC CLI to create an LPAR and update/check profile as example?

aix said...

I'm working on it...

Anonymous said...

Is there any command to find the managed system on which the LPAR resides ? I know how to find the HMC, I need the MS.

newsfromhungary said...

'uname -M' and 'uname -u' will show the machine type/model and the serial (MTMS). On the HMC, you must list each managed system's LPARs to find yours. The safest bet will be the LPAR number, as seen with 'uname -L' from AIX.

Try something like this in the CLI:

for sys in $(lssyscfg -r sys -Fname); do lssyscfg -r lpar -m $sys -Fname,lpar_id; done

aix said...

Thx a lot newsfromhungary :)
(I'm also from Hungary :))

newsfromhungary said...

Yeah, I managed to figure it out. :P

Anonymous said...

hscroot@localhost:~> rmsyscfg -r lpar -m p570 -n VIO_Server
An error occurred while deleting the partition named VIO_Server.
HSCL11C0 The Virtual I/O Server partition VIO_Server cannot be deleted because it is assigned to the reserved storage device pool or the shared memory pool.

How to force remove the VIO server? How to remove reserved storage device pool ?

aix said...

On HMC GUI you can remove Reserved Storage Device Pool: Choose a server, then in the Virtual Resources option you can find Reserved Storage Device Pool Management. There you can choose delete. After that you should be able to remove VIO server.

Anonymous said...

will this work "lshmv -v"
?

aix said...

typo , it should be "lshmc -v"

Vijender said...

Power4& HMC version 3.3.7 -->How to see the amber attention on the server and how to turn off it in command line ?

aix said...

I've never worked on these "old" versions...probably someone else knows.

Anonymous said...

Any way to find out what subnets or IP's are configured on interfaces on LPARs using HMC CLI?

aix said...

I'm not aware of any of this command. My assumption, it is not possible, because IPs are set inside the OS...

Anonymous said...

how to find managed system firmware level from HMC cli

Anonymous said...

Try
lslic -m -t syspower

Anonymous said...

lslic -m -t syspower

Anonymous said...

is there any command to know the architecture of managed server.

Anonymous said...

what precautions need to take care before rebooting dual HMCs..
Pls tell me steps ...

Anonymous said...

Actually I am Solaris Admin and beginner in AIX. These commands helped a lot.

Thanks

aix said...

Hi, I'm usually checking (asking around) if someone has a running job there, and I reboot 1 HMC at a time. After it came back, then the next one.

aix said...

:-)

Anonymous said...

I mean what backup need to take care ..

Unknown said...

Is there any command to enable/disable performance monitoring feature of HMC ?

Thanks

Bala said...

is there any errpt in hmc ? to check the errors occured since hmc is rebooted don no why

aix said...

you can check command "lssvcevents"

Anonymous said...

Is there a command to boot a lpar into sms mode?

Eze said...

Hello, i have a hmc server and a Power4 using lpar.
i need to connect both to admin partitions but i don't know how to do it cause i don't know if i need to use a serial utp, cross utp, and if the lpar console has a dhcp or i need to try to use a ip
does someone knows what i need to use?
Have a nice day

Filip Hasa said...

Greate command tool for HMC is EZH (Easy HMC Command Line Interface). http://sourceforge.net/projects/ezh/

Anonymous said...

can be acheived in 2 ways - 1. with new profile created and 2.overwriting the current profile, commands for both the ways :

1. --> hscroot@hmc> chsysstate -r lpar -m pserver -o on -f sms_profile -n my_lpar
2. --> hscroot@hmc> chsysstate -r lpar -m pserver -o on -f my_profile -b sms -n my_lpar

aix said...

thx!

aix said...

Yes, I agree!

Anonymous said...

To Boot in Verbose mode from HMC command line :

$ chsysstate -r lpar -m -o on -n -b of -f
$ mkvterm -m -p
0> boot -s verbose

----------------
Attempting to configure device 'fscsi6'
cfgmgr Time: 0 LEDS: 0x2700
Invoking /usr/lib/methods/cfgefscsi -1 -l fscsi6
Number of running methods: 4
----------------
Completed method for: fcs7, Elapsed time = 0
Return code = 0
***** stdout *****
fscsi7
*** no stderr ****
----------------
Time: 0 LEDS: 0x2700 for fscsi6
Number of running methods: 3
cfgmgr exec(/bin/sh,-c,/usr/lib/methods/cfgefscsi -1 -l fscsi6){135238,102466}
----------------
Attempting to configure device 'fscsi7'
cfgmgr Time: 0 LEDS: 0x2700
Invoking /usr/lib/methods/cfgefscsi -1 -l fscsi7
exec(/usr/lib/methods/cfgefscsi,-1,-l,fscsi6){135238,102466}
Number of running methods: 4
exec(/bin/sh,-c,/usr/lib/methods/cfgefscsi -1 -l fscsi7){122944,102466}
exec(/usr/lib/methods/cfgefscsi,-1,-l,fscsi7){122944,102466}
----------------
Completed method for: fscsi7, Elapsed time = 0
Return code = 0
*** no stdout ****
*** no stderr ****
----------------
Time: 0 LEDS: 0x2700 for fscsi6
Number of running methods: 3
cfgmgr ----------------
Completed method for: fscsi5, Elapsed time = 0
Return code = 0
*** no stdout ****
*** no stderr ****
----------------
Time: 0 LEDS: 0x2700 for fscsi6
Number of running methods: 2
cfgmgr

Anonymous said...

Is there any way to add a Virtual Ethernet adapter dynamically using command line to the running LPAR profile (not in the VIOS), I need to add lot of them. Thanks in advance.

Anonymous said...

Szia Balázs!

Do you know a solution to find the CPU speed in HMC without using ASMI, or entering to the lpar ?

Thank you!

Anonymous said...

How to get server logs when server was down and up. Eventually I wanted to calculate downtime.

Anonymous said...

if they have a RMC connection you could try "lspartition -dlpar"...

Anonymous said...

lshmc -v

Anonymous said...

Hi. Is there a cron for scheduling tasks in HMC. As for example shutdown the managed server everyday at 18.00 ?
Thanks.

Unknown said...

Hi,

How to reset administrator/system ID in FSM, i do have only pe ID available and pe have limited rights, needs to know how i can reset other id's password.

DAC said...

Usage: chlparutil -r config
[-m ]
-s
[--help]

Changes the settings for utilization data collection for managed systems.

-r - the settings to be changed:
config - configuration settings
-m - the managed system's name
-s - the sample rate in seconds
--help - prints this help

Timour Rashed said...

# lslic -m [managed_system] -t sys -Fcurr_ecnumber_primary:activated_level
01AM730:99

Anonymous said...

hmc-->system-->right click on cronjobs-->select the cronjob you wish to create-->select TimeSchedule tab... there you will find the trigger section --> right click in that section-->create trigger.

Anonymous said...

smcli resetuserpwd -u -p

Unknown said...

Best Website for AIX Admins

Anonymous said...

Where to find the hmc logs

Mohan Kumar said...

Is there any "Frame level" health check script available ?

vali said...

hmc command to modify virtual switch name?

vali said...

Command to rename the virtual switch:

chhwres -r virtualio --rsubtype vswitch -m frame1 -o s --vswitch PRODNET1 -a new_name=PRODNET0

AIX_system admin said...

hscroot@hmc3:~> chsysstate -r sys -m TSM2 -o off --immed
The command entered is either missing a required parameter or a parameter value is invalid. The required parameters for this command are -n, -r, and -o. Please check your entry and retry the command.

kumar said...

HOw to check the currently available memory (the one's which can be used ) or CPU info of a Managed System from HMC command line?

Elango said...

where i can find log " who have added memory on one of AIX server in HMC "

Unknown said...

will 4GB USB sufficient for HMC Backup ? The HMC model is 7042-CR9

aix said...

Hi, it depends on how many configuration details you have on HMC (LPARs, settings etc.) First do a backup with for example ftp, check the size and then you can decide about USB size.

justin said...

I have a errror The user "hscroot" has been temporarily disabled from logging on because the maximum number of invalid logon attempts have been exceeded

How can I resset the maximum number of invalid logon attempts. I can ssh by hscroot but can not log on web ui

adaikala raja said...

hi can you provide hmc api url for hmc processor,hmc task,hmc disk space