6.1.1. Adding Memory

If an LPAR has an active RMC connection to the HMCs, memory can be added (and of course removed) during the LPAR is running. Two conditions must be met:

    1. The current main memory size must be smaller than the maximum permitted main memory size (max_mem) for the LPAR.
    2. The required additional memory must be available.

How much memory an LPAR currently has and how much it can have at most, can easily be determined using “lpar lsmem” (list memory):

$ lpar lsmem aix22
            MEMORY         MEMORY         HUGE_PAGES 
LPAR_NAME  MODE  AME  MIN   CURR  MAX   MIN  CURR  MAX
aix22      ded   0.0  1024  4096  8192  0    0     0
$

The LPAR aix22 currently has 4096 MB main memory and can be expanded online up to 8192 MB. The main memory size can of course also be determined from the LPAR operating system:

aix22 # lsattr -El mem0
ent_mem_cap         I/O memory entitlement in Kbytes           False
goodsize       4096 Amount of usable physical memory in Mbytes False
mem_exp_factor      Memory expansion factor                    False
size           4096 Total amount of physical memory in Mbytes  False
var_mem_weight      Variable memory capacity weight            False
aix22 #

On the underlying managed system (ms06) there is currently 834816 MB (approx. 815 GB) of memory available (column AVAIL):

$ ms lsmem ms06
NAME  INSTALLED  FIRMWARE  CONFIGURABLE  AVAIL   MEM_REGION_SIZE
ms06  1048576    12032     1048576       834816  256
$

This means that 2 GB can easily be added to the LPAR aix22. The command to add the memory is “lpar addmem” (add memory):

$ lpar addmem aix22 2G
$

The amount of memory to add can be specified in KB (K or KB), MB (M or MB), GB (G or GB), or TB (T or TB). If no size unit is specified, the value is interpreted as meaning MB. The additional memory is immediately available to the operating system; no further configuration is necessary on the AIX LPAR:

aix22 # lsattr -El mem0
ent_mem_cap         I/O memory entitlement in Kbytes           False
goodsize       6144 Amount of usable physical memory in Mbytes False
mem_exp_factor      Memory expansion factor                    False
size           6144 Total amount of physical memory in Mbytes  False
var_mem_weight      Variable memory capacity weight            False
aix22 #

If an LPAR is powered off or has no active RMC connection to the HMCs, the memory can only be changed in the profile of the LPAR:

$ lpar -p standard addmem aix22 2GB
$

However, the change only takes effect when the LPAR is reactivated (specifying the changed profile).