6.2.3. Creation of LPARs with Shared Memory
Whether an LPAR should use dedicated memory or shared memory can be decided when creating an LPAR using the mem_mode attribute. The attribute mem_mode can have one of the following two values:
mem_mode : memory mode
ded - dedicated memory
shared - shared memory
We create the LPAR shlpar1 with shared memory. As with dedicated memory, the min_mem, desired_mem and max_mem attributes can be used to specify how much memory the LPAR should have at least, normally (desired) and at most.
$ lpar -m ms03 create shlpar1 mem_mode=shared desired_mem=4G max_mem=8G
> shlpar1
$
Checking the profile standard shows that an LPAR with shared memory was created. The primary paging virtual I/O server is ms03-vio1:
$ lpar -p standard lsmem shlpar1
MEMORY MEMORY HUGE_PAGES MEM PAGING_VIOS
LPAR_NAME MODE AME MIN DESIRED MAX MIN DESIRED MAX IO_ENTITLED PRIMARY SECONDARY
shlpar1 shared 0.0 1024 4096 8192 null null null auto ms03-vio1 -
$
However, creating an LPAR with shared memory does not automatically assign a paging device, as the output of “ms lspgdev” shows:
$ ms lspgdev ms03
REDUNDANT
MS_NAME DEVICE_NAME PAGING_VIOS_NAME STATE DEVICE_NAME PAGING_VIOS_NAME STATE SIZE TYPE LPAR_ID
ms03 hdisk4 ms03-vio1 Inactive - - - 51200 phys none
ms03 hdisk3 ms03-vio1 Inactive - - - 51200 phys none
$
No paging device has yet been assigned to one of the LPARs (column LPAR_ID). Next, we therefore activate the LPAR using the profile standard:
$ lpar -p standard activate shlpar1
hmc01: chsysstate -m ms03 -r lpar -o on -n shlpar1 -f standard
ERROR: remote HMC command returned an error (1)
StdErr: HSCLA457 Partition shlpar1(6) cannot be activated because its profile is missing a necessary virtual I/O adapter. Shared memory partitions are required to have at least one virtual I/O adapter of any type other than virtual serial.
$
Unfortunately, it doesn’t work that way yet. We created the LPAR shlpar1 without a virtual adapter, but the following two conditions apply in order to use of shared memory:
-
- A shared memory LPAR must not have any physical I/O adapters.
- A shared memory LPAR must have at least one virtual adapter (apart from the two standard virtual serial adapters).
We add a virtual ethernet adapter in slot 2 in order be able to activate the LPAR:
$ lpar -p standard addeth shlpar1 2 900
$
(The last argument is the PVID of the virtual Ethernet adapter, but is irrelevant here because it is not used.)
Activation of the LPAR is now successful:
$ lpar -p standard activate shlpar1
$
Now one of the two paging devices is also assigned, as the output of “ms lspgdev” indicates:
$ ms lspgdev ms03
REDUNDANT
MS_NAME DEVICE_NAME PAGING_VIOS_NAME STATE DEVICE_NAME PAGING_VIOS_NAME STATE SIZE TYPE LPAR_ID
ms03 hdisk4 ms03-vio1 Inactive - - - 51200 phys none
ms03 hdisk3 ms03-vio1 Active - - - 51200 phys 6
$
According to the output, hdisk3 was assigned as a paging device. The selection is made automatically by the hypervisor. An available paging device, which has at least the max_mem capacity of the LPAR, is selected. This ensures that theoretically even the entire memory of the LPAR could be paged out to the paging device. This does not happen, however, as a minimum amount of main memory, dependent on the LPAR, is always allocated.