Showing posts with label Quick memo for useful commands. Show all posts
Showing posts with label Quick memo for useful commands. Show all posts

Sunday, 17 March 2013

Quick memo for useful commands




Sharepools
Check if your pseries is multiple shared_pools capable :
# lssyscfg -r sys -m [managed_system] -Factive_lpar_share_idle_procs_capable
–> returns 1 if it supports multiple shared_pools, and 0 if not .
List the sharepools active on the frame and the lpars associated with’em :
# lshwres -r procpool -m [managed_system] -Fname,lpar_names
 DefaultPool,"VIO1,VIO2"
shp_oracle,"my_db_lpar1,my_db_lpar2"
shp_app,"my_app_lpar"
Changing the current sharepool for a LPAR :
# chhwres -r procpool -m [managed_system] -o s -p [lpar_name]  -a "shared_proc_pool_name=[target_sharepool_name]"
Changing the sharepool  defined in a LPAR’s profile :
 # chsyscfg -r prof -m [managed_system] -i "lpar_name=[lpar_name],name=[profile_name],shared_proc_pool_name=[target_sharepool_name]"
Hardware-related commands
Listing all I/O slots from a pseries ,sorted by device type and numbered :
/!\ (in order to do this, you need to execute the « awk |sort|uniq » part from an AIX system, because you can’t use awk with hscroot on a HMC ( I really should ask IBM why, one day… ?! it is so useful…))
# lshwres -m [managed_system] -r io --rsubtype slot\
 -F drc_name:bus_id:description| awk -F: '{print $NF}' | sort |uniq -c
24 8 Gigabit PCI Express Dual Port Fibre Channel Adapter
21 Empty slot
38 Ethernet controller
17 PCI-E SAS Controller
•          on my beautiful p795, I have 21 empty slots, 24 NPIV-capable Fibre channel adapter, 17 SAS controllers and 38 FcoE cards
•          If you wish to have more thorough information (like physical location), you juste have to remove the « awk |sort|uniq » part, which will give this kind of output (much more verbose, please note the « null » value which gives us the unassigned I/O Cards):
# lshwres -m [managed_system] -r io --rsubtype slot \
 -F drc_name:bus_id:description:lpar_name
U5803.001.9SS05BI-P1-C8:617:8 Gigabit PCI Express Dual Port Fibre Channel Adapter:null
U5803.001.9SS05BI-P1-C9:618:Ethernet controller:null
U5803.001.9SS05BI-P1-C10:619:Ethernet controller:null
U5803.001.9SS05BI-P1-C4:612:Ethernet controller:null
[...]
U5803.001.9SS05BI-P2-C3:1042:Empty slot:null
U5803.001.9SS05BI-P2-C7:1048:Ethernet controller:VIO2
U5803.001.9SS05BI-P2-C8:1049:Ethernet controller:VIO1
U5803.001.9SS05BI-P2-C9:1050:8 Gigabit PCI Express Dual Port Fibre Channel Adapter:VIO2
U5803.001.9SS05BI-P2-C5:1045:PCI-E SAS Controller:VIO1
lpar-related actions
Shutting down a LPAR:
# chsysstate -m [managed_system] -r lpar -n [lpar_name] -o shutdown [--immed]
rename a lpar (easy):
# chsyscfg -m  [managed_system] -r lpar  -i "name=my_lpar_name,new_name=my_new_lpar_name"