打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
AIX for System Administrators
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 virualio --rsubtype vswitch shows virtual switches with configured vlan ids on them
lshwres -m <sys> -r virualio --rsubtype eth --level lpar   shows virt. ethernet adapters with lpar_name,slot_id, vlan_id....
lshwres -m <sys> -r virualio --rsubtype fc --level lpar    shows virt. fc adapters with lpar_name,slot_id, wwpns...
lshwres -m <sys> -r virualio --rsubtype scsi --level lpar shows vscsi adapters with lpar_name,slot_id...

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


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Prof. RB Kaner 简介
PowerVM 搭建:VIOS服务器快速搭建技巧及经验
获取数据表中列的描述值
华为无线之WLAN组网配置
HTML Entity 字符实体(字符转义), 如 nbsp
AC+AP时代
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服