PowerVM

Some old notes that really need to be rewritten...

### HMC commandline

Are there enough free resources?

lsavailres -m Server-9117-570-x

lshwres --level sys -m Server-9117-570-x -r proc

lshwres --level sys -m Server-9117-570-x -r mem

Create new LPAR

mksyscfg -r lpar -m MgdSys -i \ "name=$name,profile_name=normal,lpar_env=aixlinux,min_mem=1024,desired_mem=4096,max_mem=4096, min_proc_units=0.1,desired_proc_units=0.2,max_proc_units=0.2, min_procs=1,desired_procs=2,max_procs=2,proc_mode=shared,sharing_mode=uncap,uncap_weight=32, max_virtual_slots=100,conn_monitoring=0"

Change LPAR

chsyscfg -r prof -m MgdSys -i "name=normal,lpar_name=LPARName,..."

LPAR ID cannot be changed!

Rename LPAR

chsyscfg -r lpar -m MgdSys -i "name=OldName,new_name=NewName"

virtual_scsi_adapters= # see below

virtual_eth_adapters= # none

with LHEA

lhea_logical_ports= [adapter_id,port_group,phys_port_id,logical_port_id,vlan_id_list] lhea_capabilities= [adapter_id,capability] lpar_proc_compat_mode= ???

add a Virtual Server SCSI adapter and give a non used Slot number

chsyscfg -r prof -m Server-9406-MMA-x -i \ "name=normal,lpar_name=foo,virtual_scsi_adapters=\ 15/server/any//any/0,13/server/any//any/0,23/server/any//any/0,21/server/any//any/0,11/server/any//any/0, 14/server/any//any/0,25/server/any//any/0,24/server/any//any/0,12/server/any//any/0,22/server/any//any/0, 16/server/any//any/0,26/server/any//any/0\""

add a Virtual Client SCSI adapter and give it a Slot Number

chsyscfg -r prof -m Server-9406-MMA-x -i \ "name=normal,lpar_name=foo,virtual_scsi_adapters=\"15/client/9/vio4/15/1,25/client/9/vio4/25/1\""

cfgdev

lshwres -m Server-9406-MMA-x -r hea --rsubtype logical --level port -F --header # show all HEA ports (lhea_logical_ports)

lspartition -c 9117-570_x -dlpar

### ---- VIO Server

mkvg -vg VGName hdiskX hdiskY ... # 1.) create new VG

lsvg

lsvg VGName # traditional lsvg; check free PPs

lsvg -lv VGName # = lsvg -l VGName; closed/syncd are unused

mklv -lv LVName VGName Size # 2.) create a LV

mklv -lv root11lv client0vg 30G # Example

lsdev -vpd | grep vhost # Determine where the "-dev" is located, ie on which adapter

mkvdev -vdev LVName -vadapter AdapterName -dev VirtualDev

mkvdev -vdev root11lv -vadapter vhost0 -dev root11dev

lsvopt # list loaded vopt devices

lsmap -all | grep vhost # list vhost to adapter number mapping

/usr/ios/cli/ioscli lsmap -all | egrep "vhost|VTD|Backing" # as root, you can egrep relevant lines -- note: padmin has grep -E

mkvdev -fbo -vadapter vhost4 # create a virtual optical drive on a vadapter

mkvopt -name Name -file /Path/To/File -ro # create a virtual optical device from an ISO image

loadopt -disk VoptDevice -vtd VirtualSCSIAdapter # mount ISO image

loadopt -disk aix6101-1 -vtd vtopt1

unloadopt -vtd VirtualSCSIAdapter

unloadopt -vtd vtopt3

chvopt -name aix6100-1 -mv aix6101-1 # rename a vopt device

cfgdev

lscfg -vl vscsi0 # U9406.595.x-V32-C15-T1 => the Cxx indicates the SCSI slot number!

---

Disk replacement

1.) Client:

* rmlvcopy LVName 1 hdiskN

* reducevg VGName hdiskN

* rmdev -dl hdiskN

2.) VIO Server:

* root# lspv -l hdiskN # determine affected LVs

* root# lsvg -l VGName # determine which LV is allocated

* lsmap -all; lsmap -vadapter vhostN # determine affected VTDs

* rmdev -dev VTD # remove all VTDs ('lsmap -all')

* rmlv -f ClientLV # remove client LVs

* reducevg VGName PVName

* diagmenu # replace disk

* extendvg VGName PVName

* mklv -lv ClientLV rootvg 10G # recreate the client LVs

* mkvdev -vdev ClientLV -vadapter vhostN # map the client LV to the appropriate vhosts

---

"In column within the list you have many blank cells. Select column, then Ctrl+G - Special - Blanks - OK. Now "=" - "Up" - Ctrl+Enter." # Excel: fill blank cells with the content from the cell above them

### HMC - General

mkauthkeys -a "ssh-rsa [rsa_key] user@myhost" # add remote host's RSA key to .ssh/authorized_keys2; enable key based login to hmc

chhmc -c xntp -s enable; tail -f /var/log/messages # turn on/check ntpd on the HMC

TCP/IP Ports

22/tcp ssh

443/tcp

9960/tcp https

5989/tcp pegasus

5988/tcp

9197/tcp csm-snia

657/tcp

657/udp rmc

hscroot@hmc:~> cat /sys/class/net/eth1/address

00:0d:60:ed:c5:86

rsthwres -m Server-9406-595-x -r [ proc | mem | io ... ] # resync hw data from lpars to hmc

### HMC - Adapters - Ethernet - HEA

lshwres -r hea -m MgdSys --rsubtype phys --level sys # list HEAs: drawer, location; map adapter ID to drawer

lshwres -r hea -m MgdSys --rsubtype phys --level port -F --header # list all HEA physical ports

lshwres -r hea -m MgdSys --rsubtype phys --level port -F conn_state,adapter_id,phys_port_loc | grep ^1 # list HEA adapters with active link

lshwres -r hea -m MgdSys --rsubtype logical --level port -F state,port_group,adapter_id,drc_index,lpar_name # list all HEA logical ports

lshwres -r hea -m MgdSys --rsubtype logical --level port -F state,port_group,adapter_id,drc_index,lpar_name | grep ^1 # list HEA logical ports with active link

mksysconn --ip 172.17.254.255 -r sys # create new HMC connection to a MgdSys (management network)

### HMC - Adapters - I/O

lshwres -m MgdSys -r io --rsubtype slot -F drc_name,description,lpar_name

### HMC - Adapters - Virtual I/O

lshwres -m MgdSys -r virtualio --rsubtype slot --level lpar -F --header # list virtual SCSI slots (= max number of slots)

lshwres -m MgdSys -r virtualio --rsubtype scsi --level lpar -F --header # list virtual SCSI adapters

lshwres -m MgdSys -r virtualio --rsubtype scsi --level lpar -F lpar_name,slot_num,remote_slot_num,remote_lpar_name # list virtual SCSI adapters (short form)

### NIM

nim -o bos_inst -a source=rte -a lpp_source=Lpp_Source -a spot=SPOTName -a accept_licenses=yes -a boot_client=no ClientName # install from NIM server; requires manual configuation and initiation of network boot from the client

nim -o deallocate NimResource NimClient # deallocate NIM resource

nim -o change -a new_name=NewName OldName

### Virtual I/O Server

PATH=/usr/ios/cli:/usr/ios/utils:/usr/ios/lpm/bin:/usr/ios/oem:/usr/ios/ldw/bin:$HOME # padmin $PATH on VIO 1.5

shutdown -restart # reboot VIO server

diagmenu # diag

### RMC

ls -ltr /var/ct/cfg # you should see the *acls* files

lsrsrc IBM.ManagementServer # you should see the HMCs

/usr/sbin/rsct/bin/ctsthl -l # Contents of trusted host list file

rmcctrl -z; rmcctrl -d; rmcctrl -A # 'recycle' RMC

# OR: rmcctrl -z; rmcctrl -k; rmcctrl -s

rmcctrl # without options, shows help

Logs of DLPAR operations

On AIX:

ps -ef | grep drmgr

lsof -C drmgr

# alog -o -t cfg | egrep "drmgr.*mem|start time"

CS 36307162 8650802 /usr/sbin/drmgr -r -c mem -q 40 -w 5 -d 1

C4 36307162 user_time:300, current time: 0x50ae6d3e, DR start time: 0x50ae6d3

# echo "ibase=16;$( echo 50ae6d3e | tr [[:lower:]] [[:upper:]] )" | bc

1353608510

# perl -le 'print scalar localtime(1353608510)'

Thu Nov 22 19:21:50 2012

On the HMC:

/var/hsc/log/evt_processor.log