Thursday, July 8, 2010

HMC Command line than graphics

To view HMC information like serial number, Model, Version, release, hostname its lshmc -v and -V
hscroot@apdochmc1p:~> lshmc -v
"vpd=*FC ????????
*VC 20.0
*N2 Thu Jul 08 18:49:42 SGT 2010
*FC ????????
*DS Hardware Management Console
*TM 7042-CR4
*SE SERLNUMBER
*MN IBM
*PN Unknown
*OS Embedded Operating Systems
*NA
*FC ????????
*DS Platform Firmware
*RM V7R3.4.0.0
"
hscroot@apdochmc1p:~>
hscroot@apdochmc1p:~>
hscroot@apdochmc1p:~> lshmc -V
"version= Version: 7
Release: 3.4.0
Service Pack: 0
HMC Build level 20081204.1
MH01152: Required fix for HMC V7R3.4.0 (12-04-2008)
","base_version=V7R3.4.0
"
hscroot@apdochmc1p:~>

To view HMC Network configuration

#lshmc -n

To show processor usage by partition

#lshwres -m msname -r proc --level lpar -F lpar_name,run_procs --header

To start a virtual console

#mkvterm -m mansystem -p lparname


To enable ssh remote execution from another server without password

#ssh-keygen -t rsa as 'root' in NIM server (or the host from u connect)
#scp hmchostname:.ssh/authorized_keys2 ~/.ssh/temp_hmcauthkeys2

To copy the hmc keys file to local

#cat ~/.ssh/id_rsa.pub >> ~/.ssh/temp_hmcauthkeys2

To add pub keys from local system

#scp ~/.ssh/temp_hmcauthkeys2 hmchostname:.ssh/authorized_keys2

To update hmc keys file
On first login it will ask for keys exchange give yes



There are thre options to start a manged system from hmc

1 Partition standby ( from here one by one partitions are started)
2 System profile ( they are collection of partition profiles named for usage. select a profile and start)
3 Partition auto start ( the partitions are started with last running configuration)

#chsysstate -m mndsys -o onstandby -r sys
#chsysstate -m mndsys -o onsysprof -r sys -f profilename
#chsysstate -m mndsys -o on -r sys

respectively

To view state of manged system

#lssyscfg -r sys -m managedsys -F state --header( header to list options under header)

To poweroff

Shutdown all lpars from os. Or use hmc option operating system shutdown
Then power off managed system
#chsysstate -r sys -m managedsys -o off

MEMORY FOR LPARS

LMB - is the size of unit of memory can be allocated to a partition. You have to add remove or adjust an lpars memory amount in multiples of LMB.

LMB varies depending on the Total Physical memory available as below.

4GB n less LMB 16 MB default
4-8 GB 32 MB default
8-16 GB 64MB and so on to 256MB

Partition profiles - Configuration for lpars. Contains lpar_name, memory, cpu, IO, startup mode etc.
System profile - Collection of partition profiles. An lpar can have multiple profiles with different mem/cpu/io parameters provided that only one profile is active at a time. For example you have a set of UAT servers to run on less resources at the begining of the month you can put those profiles in to a group managed sys profile and activate /deactivate easily.

Order of creating profiles - Create a partition with default profile, then create additional profiles, create system profile

CPU, MEM Allocation for lpars

Minimum - Lpar won't start without the minimum even to the firmware level. An lpar will be running memory/cpu much more than the minimum normally depends on the desired amount selected. The amount can be reduced as low as minimum using dlpar property online.

Desired - Lpar Starts with this amount if available or an amount between the minmum and desired if not fully available.

Maximum- Normally not used by startup. We can add resources (mem/cpu) up to this amount using dlpar on the fly.

An amount of memory is used by the hypervisor, Translation Control Entries, page tables for each partition (memory mapping) etc
for 32 to 64 system memory partition table takes 1GB
from 64-128 2GB and so on

To list memory info
#lshwres -r mem -m mndsys --level sys

Installed mem - Total physical memory available in system.
Deconfigured - faulty
Configurable - Total physical memory after reducing faulty mem or COD memory inactive amount if any
Available - Free after usage by the lpars


I/O resources are added as either required or desired

Required - lpar won't start if not available.
Desired - Can be moved using dlpar, Lpar starts even when they not available..

To know the lpar info from aix

# uname -L

To Know the HMC name from an lpar commandline

#lsrsrc IBM.ManagementServer

To activate partition

#chsysstate -m mndsys -r lpar -o on -f profilename -n LPARname

For a manged system the states are

Power off -off
Initializing - powering on
Standby - partition standby mode
Operating - At least 1 partition on
Pending authorzation - hmc is yet to get authorized with the HMC user password of SP
Authorization failure - The hmc user password mismatch
Incomplete - hmc not able to gather proper info
No connection - handshake for ip conn failed
Recovery - hmc / SP nvram mismatch. You may need to restore from backup or initialize system with SP contents
Error- error need to log call with IBM
Cod click to accept - enter activation code for COD

To view state of managed systems

#lssyscfg -r sys -m mandsys -F state --header

To open terminal console to lpar

#mkvterm -m mndsys -p lparname

To exit from console press ~.

To remove an active console connection

#rmvterm -m mndsys -p lparname

For stopping partition

#chsysstate -m mndsys -o shutdown -r lpar -n lparname --immed (after os is hsutdown)
or
#chsysstate -m mndsys -o osshutdown -r lpar -n lparname (Before os is hsutdown)


The managed systems profiles backup is taken with command

#bkprofdata -m mndsysname


To restore

#rstprofdata -m mndsys -f /mn/floppy/mybackup -l 1 (full restore) 2 ( bavckup prior) 3 (mandsys priority)

To see processor info lpar vice

#lshwres -m mandsys -r proc --level lpar

To see dedicated or virtual proc info

#lshwres -m mangedsys -r proc --level lpar -F lpar_name,run_procs --header

To see magedsys mem info

#lshwres -r mem -m mndsys --level sys

To see mem by lpar

#lshwres -r mem -m mndsys --level lpar

To view info virualio scsi slots

#lshwres-r virtualio --rsubtype scsi -m mndsys

For moving memory from one partition to other using DLPAR

#chhwres -r mem -m SYS:9131-52A-SNXXE2G -o m -p lparapp1t -t lparapp1d -q 28672

For adding memory in one

#chhwres -r mem -m SYS:9131-52A-SNXXE2G -o a -p lparapp1d -q 28672

For adding processors in one partition

#chhwres -r proc -m SYS:9131-52A-SNXXE2G -o a -p lparapp1d --procs 3

For moving processor from one partition to other

#chhwres -r proc -m SYS:9131-52A-SNXXE2G -o m -p lparapp1d -t fincnapp1t --procs 3


To restart partition

#chsysstate -m SYS:9131-52A-SNXXE2G -r lpar -o shutdown --id 3 --immed --restart


To reactivate partition

#chsysstate -m SYS:9131-52A-SNXXE2G -r lpar -o shutdown --id 3 --immed
#chsysstate -r lpar -m SYS:9131-52A-SNXXE2G -n lparapp1d -o on -f lparapp1d_profile


To update managed system from microcode rpm file copied under hscroot home dir of hmc.

#updlic -m SYS:9117-570-SNXXE2G-t all -l latest -o a -r mountpoint -d /home/hscroot/Microcode

To view microcode after update

#lslic -t sys -m SYS:9117-570-SNXXE2G

To delete entries of mndsys from exclude file for non detecting Manageddsystem SP objects

#mksysconn -o auto

To list all systems connections to HMC

#lssyconn –r all

To see remote access settings for HMC

#lshmc –r

To change remote access settings

#chhmc -c xntp -s enable

To backup critical console data to DVD

#bkconsdata -r dvd (It can also be backed up to nfs or ftp site.)

To save upgrade data (Normally to a particular area of disk before upgrade)

#saveupgdata -r disk (or for saving to disk and then dvd) saveupgdata -r diskdvd

To restore upgrade data

#rstupgdata (or rstupgdata –r dvd to get data from dvd. Once command issued HMC restores it on the reboot.)

To update hmc code from local file

#updhmc –t l –f /home/hscroot/Update1.zip

To create an hmc user

#mkhmcusr -u sysadmin -a hmcsuperadmin

To change attribute of hmc user

#chhmcusr -u tester -t taskrole -v hmcoperator
To list HMC serviceable events for last three days

#lssvcevents -t hardware -d 3 (-t console for hmc related)

To close all serviceable events

#chsvcevent -o closeall

To activate COD Advanced power virtualization features (To enter feature code from HMC)

#chvet -m mySystem -o e -k AlphaNumericString12345

To view COD features activation log for a managed system

#lsvet -m 9117-570FC54678 -t hist

To display CUoD processor capacity information of a manged system

#lscod -m 9406-570*98127634 -t cap -r proc -c cuod

To enter a CoD code

#chcod -m sys1 -o e -k AlphaNumericString12345

To activate 2 GB of On/Off CoD memory for 10 days

#chcod -m 9406-570*1001CA -o a -c onoff -r mem -q 2048 -d 10

To increase to 5 GB of On/Off CoD memory for 3 days

#chcod -m 9406-570*1001CA -o a -c onoff -r mem -q 5120 -d 3

To activate 3 Reserve CoD processors

#chcod -m 9406-570*1001CA -o a -c reserve -r proc -q 3

To remove temporary HMC files which have not been modified during the last 36 hours from the /var file system

#chhmcfs -o f -h 36 -f /var

To view hmc filesystems

#lshmcfs

To display the physical SA LED for the system:

#lsled -m 9406-579*100103C -r sa -t phys

To display the virtual partition SA LEDs for partitions lpar1 and lpar2:

#lsled -m system1 -r sa -t virtuallpar --filter ""lpar_names=lpar1,lpar2""





To list all storage devices available on HMC

#lsmediadev

To migrate the partition with ID 5 from managed system system1 to managed system system2:

#migrlpar -o m -m system1 -t system2 --id 5 -n migprof -i "virtual_scsi_mappings=12//1, dest_msp_id=1,source_msp_id=3"

To Create new LPAR using command line

#mksyscfg -r lpar -m MACHINE -i name=LPARNAME, profile_name=normal, lpar_env=aixlinux, shared_proc_pool_util_auth=1,min_mem=512, desired_mem=2048, max_mem=4096, proc_mode=shared, min_proc_units=0.2, desired_proc_units=0.5,max_proc_units=2.0, min_procs=1, desired_procs=2, max_procs=2, sharing_mode=uncap, uncap_weight=128,boot_mode=norm, conn_monitoring=1, shared_proc_pool_util_auth=1


If we have multiple lpars to create you can use the below method of specitying them in a file name and creating.


#vi lpar_profiles.txt

name=LPAR1,profile_name=normal,lpar_env=aixlinux,all_resources=0,min_mem=1024,desired_mem=9216,max_mem=9216,proc_mode=shared,min_proc_units=0.3,desired_proc_units=1.0,max_proc_units=3.0,min_procs=1,desired_procs=3,max_procs=3,sharing_mode=uncap,uncap_weight=128,lpar_io_pool_ids=none,max_virtual_slots=10,"virtual_scsi_adapters=6/client/4/vio1a/11/1,7/client/9/lpar1/11/1","virtual_eth_adapters=4/0/3//0/1,5/0/4//0/1",boot_mode=norm,conn_monitoring=1,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,shared_proc_pool_util_auth=1
name=LPAR2,profile_name=normal,lpar_env=aixlinux,all_resources=0,min_mem=1024,desired_mem=9216,max_mem=9216,proc_mode=shared,min_proc_units=0.3,desired_proc_units=1.0,max_proc_units=3.0,min_procs=1,desired_procs=3,max_procs=3,sharing_mode=uncap,uncap_weight=128,lpar_io_pool_ids=none,max_virtual_slots=10,"virtual_scsi_adapters=6/client/4/vio1a/12/1,7/client/9/lpar2/12/1","virtual_eth_adapters=4/0/3//0/1,5/0/4//0/1",boot_mode=norm,conn_monitoring=1,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,shared_proc_pool_util_auth=1

Copy this file to HMC and run

#mksyscfg -r lpar -m MANGDSYS -f /home/hscroot/lpar_profiles.txt

Commands to edit partition profiles

To change a partition profile's memory amounts (reduce the profile's current memory amounts each by 256 MB), and number of desired processors:

#chsyscfg -r prof -m sys1 -i "name=profile1, lpar_name=partition3,min_mem-=256,desired_mem-=256, max_mem-=256,desired_procs=2"

To change a system profile (add 2 new partition profiles):

#chsyscfg -r sysprof -m sys1 -i "name=sysprof1, "lpar_names+=partition3,partition4", "profile_names+=3_prof1,4_defaultProf""



While adding /removing IO slots to profile or while moving IO slots we need to use Drc Index number for the particular IO slot. It can be seen from the commands

#lshwres -r io -m FINACLE-TAIWA-9117-570-ORQSrv01 --rsubtype slot grep lpar_name or drc_index number


Scheduling operations like managed systems on/off, activate system profiles for managed systems and activate/stop, conduct DLPAR operations for lpars is to be done from GUI.

2 comments:

  1. hey, a quick question. Firmware is still blurry for me but this blog entry is really helpfull...
    So, question is, is the frimware requiring mem when adding lpars for example? If so, is there a formula to use to find out how much mem should be made available for th efirmware when adding hw?

    Thanks in advance

    ReplyDelete
  2. Is it possible to get the LPAR uptime or LPAR activated time from the HMC for all the LPARs

    ReplyDelete