AIX DLPAR of Memory, Processor and Adapters using HMC CLI

HMC provide command line chhwres to perform multiple set of operation. Will be explaining dlpar of Network and Storage adapters, Processor and Memory.
DLPAR of Network and Storage adapters, list down the adapters with its drc index and lpar list. Then perform the dlpar using below script to attach the fibre channel or detach the fibre channel adapter. After attaching the fibre channel run cfgmgr or cfgdev on VIOS partition or AIX partition. To detach the fibre channel adapter run rmdev -dl hdiskX on VIOS/AIX partition then detach the adapter using chhwres command line.

List the storage physical adapters connected to vios or logical partitions and attach or detach it


$  
$  lshwres -r io --rsubtype slot -m system1 -Funit_phys_loc:lpar_name:description:drc_name:drc_index | grep 21010026
U78D5.ND2.CSS378F:null:PCIe3 2-Port 32Gb FC Adapter:U78D5.ND2.CSS378F-P1-C7-C1:21010026
$  
$  
$  chhwres -r io -m system1 -o a -p partition01 -l 21010026
$  echo $?
0
$    
$  lshwres -r io --rsubtype slot -m system1 -Funit_phys_loc:lpar_name:description:drc_name:drc_index | grep 21010026
U78D5.ND2.CSS378F:partition01:PCIe3 2-Port 32Gb FC Adapter:U78D5.ND2.CSS378F-P1-C7-C1:21010026
$  
$  chhwres -r io -m system1 -o r -p partition01 -l 21010026
$  echo $?
0
$  
$  lshwres -r io --rsubtype slot -m system1 -Funit_phys_loc:lpar_name:description:drc_name:drc_index | grep 21010026
U78D5.ND2.CSS378F:null:PCIe3 2-Port 32Gb FC Adapter:U78D5.ND2.CSS378F-P1-C7-C1:21010026
$  
$  

Below commands perform dlpar of NVMe adapter named U78D5.ND2.CSS378F-P2-C1 attach and detach from the partition01 using the drc index.

$  
$  
$  lshwres -r io --rsubtype slot -m system1 -Funit_phys_loc:lpar_name:description:drc_name:drc_index | grep 21010028
U78D5.ND2.CSS378F:null:800GB NVMe Gen3 U.2 Slim SSD:U78D5.ND2.CSS378F-P2-C1:21010028
$  chhwres -r io -m system1 -o a -p partition01 -l 21010028
$  echo $?
0
$  lshwres -r io --rsubtype slot -m system1 -Funit_phys_loc:lpar_name:description:drc_name:drc_index | grep 21010028
U78D5.ND2.CSS378F:partition01:800GB NVMe Gen3 U.2 Slim SSD:U78D5.ND2.CSS378F-P2-C1:21010028
$  
$  chhwres -r io -m system1 -o r -p partition01 -l 21010028
$  echo $?
0
$  
$  lshwres -r io --rsubtype slot -m system1 -Funit_phys_loc:lpar_name:description:drc_name:drc_index | grep 21010028
U78D5.ND2.CSS378F:null:800GB NVMe Gen3 U.2 Slim SSD:U78D5.ND2.CSS378F-P2-C1:21010028
$  

DLPAR of processor

Dynamic Partitioning of Processor can be performed using HMC management console command line. Find out the min and maximum processor capability applicable to the partition depending upon the values set or change the values of processor.

$ lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition01" -Fcurr_min_procs:curr_procs:curr_max_procs
6:7:8
$ chhwres -r proc -m system1 -o a -p partition01 --procs 1
$ echo $?
0

$ lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition01" -Fcurr_min_procs:curr_procs:curr_max_procs
6:8:8
$ chhwres -r proc -m system1 -o r -p partition01 --procs 1
$ echo $?
0
$ lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition01" -Fcurr_min_procs:curr_procs:curr_max_procs
6:7:8
$

List out the values and DLPAR of shared processor


$ lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition02" -Fcurr_min_proc_units:curr_proc_units:curr_max_proc_units
1.0:1.0:4.0

$ lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition02" -Fcurr_min_procs:curr_procs:curr_max_procs
1:2:4

$ chhwres -r proc -m system1 -o a -p partition02 --procs 2 --procunits 2.0
$ echo $?
0
$ lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition02" -Fcurr_min_procs:curr_procs:curr_max_procs
1:4:4
$ lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition02" -Fcurr_min_proc_units:curr_proc_units:curr_max_proc_units
1.0:3.0:4.0


DLPAR of memory


Memory allocated to partition can be modified using hmc command chhwres dynamically using the below examples. List out the memory and set the memory values.

$ lshwres -r mem -m system1 --level lpar --filter "lpar_names=partition01" -Fcurr_min_mem:curr_mem:curr_max_mem
40960:46080:51200
$ chhwres -r mem -m system1 -o a -p partition01 -q 1024
$ echo $?
0

$ lshwres -r mem -m system1 --level lpar --filter "lpar_names=partition01" -Fcurr_min_mem:curr_mem:curr_max_mem
40960:47104:51200
$ chhwres -r mem -m system1 -o r -p partition01 -q 1024 
$ echo $?
0


We require either partition should be shut down to change desired, min and max values. When partition is running and RMC is up we will only be able to change only desired values.


Script to Perform DLPAR of CPU


while :
    do
    lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition01" -Fcurr_min_procs:curr_procs:curr_max_procs
    sleep 40
    chhwres -r proc -m system1 -o r -p zeelpm04 --procs 1
    echo $?
    sleep 40
    lshwres -r proc -m system1 --level lpar --filter "lpar_names=partition01" -Fcurr_min_procs:curr_procs:curr_max_procs
    sleep 40
    chhwres -r proc -m system1 -o a -p partition01 --procs 1
    echo $?
    sleep 40
done

The script will run continously in infinite loop where first command lshwres will list down the current settings, then chhwres second command with "-o r" option will reduce the CPU by one unit. The third command lshwres will again list the current settings, the fourth command will add the cpu to partition with one unit. Net net the script will reduce the cpu and add the cpu at the end with delay of 40 seconds.