6.1. Dedicated Memory

An LPAR can operate with either dedicated memory or shared memory, but not both at the same time. If dedicated memory is used, it is only available to one LPAR and cannot be used by other LPARs.

When assigning dedicated memory, one or more physical memory areas are assigned. The size of such a physical memory are must be a multiple of the so-called Logical Memory Block (LMB) size. The LMB size is configurable and depends on the managed system. It can be displayed with the command “ms lsmem” (list memory resources). Without any further arguments, all existing managed systems are listed:

$ ms lsmem
NAME     INSTALLED  FIRMWARE  CONFIGURABLE  AVAIL   MEM_REGION_SIZE
ms01     524288     6656      524288        498176  256
ms03     524288     14848     524288        26112   256
ms04     524288     12544     524288        61184   256
ms05     1048576    27392     1048576       81664   256
ms06     1048576    25600     1048576       0       256
ms07     2097152    43776     2097152       859392  256
ms08     2097152    50176     2097152       740352  256
$

The LMB size of a managed system can be taken from the column MEM_REGION_SIZE, the size is in MB.

Figure 6.1 shows the assignment of main memory for some LPARs to the physical memory of the managed system. The main memory of an LPAR can easily be composed of several physical memory areas!

 

Dedicated memory of some LPARs
Figure 6.1: Dedicated memory of some LPARs

When creating a new LPAR, the mem_mode attribute can be used to specify whether dedicated memory should be used or shared memory (AMS):

mem_mode : memory sharing mode
ded - dedicated memory
shared - shared memory

A new LPAR can be created with the “lpar create” command. By default, LPARs are created with dedicated memory:

$ lpar -m ms02 create lpar3
.
    > lpar3
$

The option “-m” with the target managed system must be specified, it defines on which of the managed systems the LPAR is to be created. The LPAR name, here lpar3, is optional. If no name is given, the LPAR tool generates a unique name.

A newly created LPAR is initially not activated. The greater part of the LPAR configuration is stored in a profile that is created when the LPAR is generated. By default, the name standard is used for the profile, but a different default can also be configured. A look at the profile standard shows that the LPAR was configured with 1024 MB dedicated memory (column MEMORY DESIRED):

$ lpar -p standard lsmem lpar3
            MEMORY          MEMORY             HUGE_PAGES    
LPAR_NAME  MODE  AME  MIN   DESIRED  MAX   MIN   DESIRED  MAX
lpar3      ded   0.0  1024  1024     1024  null  null     null
$

If an LPAR is to have more than 1024 MB of memory, the desired memory size can be specified using the desired_mem attribute:

$ lpar create -m ms02 lpar4 desired_mem=4096
    > lpar4
$

The specified memory size must be an integer multiple of the LMB size. In the profile standard of the LPAR lpar4, 4096 MB is set as desired:

$ lpar -p standard lsmem lpar4
            MEMORY          MEMORY             HUGE_PAGES    
LPAR_NAME  MODE  AME  MIN   DESIRED  MAX   MIN   DESIRED  MAX
lpar4      ded   0.0  1024  4096     4096  null  null     null
$

In addition to the attribute desired_mem for the desired memory size, there are two other attributes, namely min_mem and max_mem. Just like desired_mem, these attributes can also be specified on the command line when creating an LPAR. The value of min_mem must be less than or equal to the value desired_mem, which in turn must be less than or equal to the value max_mem:

min_mem <= desired_mem <= max_mem

The value of min_mem comes into play at least in the following two situations:

    • An LPAR is activated, but not as much physical main memory is available as required by desired_mem. In this case, PowerVM reduces the amount of memory allocated to the LPAR to a smaller value. However, the value of min_mem must not be undercut.
    • With an active LPAR with a running operating system, memory can be dynamically added or removed without having to stop the operating system or applications. The main memory size can be increased up to a maximum of the value of max_mem or reduced up to a minimum of the value of min_mem.

As just described, the value of max_mem is taken into account when dynamically increasing the main memory.

This is analogous to the min_procs, desired_procs and max_procs attributes for processors.

Which attributes can be specified and which possible values these attributes can have, can be looked up in the online help:

$ lpar help create
USAGE:
lpar [-h ] [-m ] [-p ] create [{-b |-s }] [-v] [] [ ...]

DESCRIPTION

Create a new LPAR on a managed system.

-b : blueprint to use for creation'
-s : source LPAR to use as blueprint'

Valid attributes:
name : name for the LPAR
lpar_id : the ID of the LPAR
profile_name : name of the default profile
lpar_env : type of LPAR
aixlinux - AIX or Linux (default)
os400 - IBM i
vioserver - virtual I/O server
min_mem : minimum amount of memory in MB
desired_mem : desired amount of memory in MB
max_mem : maximum amount of memory in MB
mem_expansion : Active Memory Expansion
0 - disable AME
1.00-10.00 - expansion factor

$