Like other virtualization software, HP Integrity Virtual Machines comes with several memory management capabilities. In this new post about HPVM I will try to explain what are these capabilities, their purpose and how to configure and use them.
Dynamic memory is an HPVM feature that allow you to resize the amount of memory of a guest without rebooting it. The HPVM manual mention an example in which dynamic memory is applicable.
…this feature allows a guest that is a Serviceguard node to be used as a standby server for multiple Serviceguard packages. When a package fails over to the guest, the guest memory can be changed to suit the requirements of the package before, during, and after the failover process.
Dynamic memory is only available on HP-UX guests with the guest management software installed.
Lets see how to enable an configure dynamic memory.
First thing to do is to enable dynamic memory.
There are three possible values for the
- None: Self explanatory.
- Any: In the next boot of the guest it will check if dynamic memory is enabled and if the driver is loaded. If the dynamic memory driver is in place the option will change its value to
- Driver: When the
ram_dyn_typeis set to
driverit means that every dynamic memory control and range is functional.
Specify the minimum amount of RAM to be allocated to the guest, the default unit is MB but GB can also be used.
Next set the maximum memory.
Set the amount of memory to be allocated when the guests starts, this value must be greater than the minimum one.
Check the status of the guest to see the newly configured options.
Once dynamic memory is properly configured, from the VM host, the memory of a guest can be manually resized to a value between the
ram_dyn_max parameters in increments of the default chunk size, which is 64MB.
There is one final option named
dynamic_memory_control, with this option the system administration can allow the root user of the guest to change dynamic memory options, from the guest side, while it is running. The
dynamic_memory_control option is incompatible with automatic memory reallocation.
Just to show a small example from the guest side, to view the dynamic memory configuration:
Automatic memory reallocation
The new HPVM 4.2 version from March expands dynamic memory with an interesting feature called Automatic Memory Reallocation. This new feature provides the possibility of automated changes in the amount of memory used by a guest based on load conditions.
Automatic memory reallocation is only supported on HP-UX guests with dynamic memory enabled and with the guest management software installed.
Automatic memory reallocation can be configured through two ways:
- System-wide values.
- On a per-VM basis.
Each way doesn’t exclude the other one, you can set the system-wide parameters for every VM and later customize some of the virtual machines adjusting their parameters to any additional requirement.
Automatic memory reallocation is enabled by default on the VM host. Open the file
/etc/rc.config.d/hpvmconf and check that
HPVMAMRENABLE=0 is not set to verify that automatic memory reallocation is enabled. The process
hpmvmamrd, the automatic memory reallocation daemon, can also be check with a simple
In the same file two system-wide tunables can be configured.
The first parameter determine the number of megabytes by the guest will attempt to grow if there is memory pressure. If the parameter is not set the default value will be 256MB. The best practice for this parameter is to be a multiple of the dynamic memory chunk size.
The second one set the maximum number of seconds that any VM startup process will wait for memory before reporting a failure due to insufficient memory. The default value is 60 seconds and the maximum configurable 600 seconds.
With the above parameter set to its defaults or customized the next step is to enable automatic memory reallocation in the virtual machines. The
amr feature is DISABLED by default on the VMs. To enable use the
Now set the memory entitlement for the virtual machine. The entitlement is the minimum amount of RAM guaranteed to the virtual machine.
Take into account that if
amr is not enabled the entitlement could be set but it will not work and any VM without the entitlement parameter set will be ignored by automatic memory reallocation.
The entitlement value can be modified online by the system administrator at any time, but there are some rules that apply:
- If there is not enough memory to grow the VM memory to the specified entitlement the operation will fail.
- The memory of virtual machine can not be grown beyond its maximum memory.
- The virtual machine memory always have to be set to a value between
ram_dyn_minparameters, no more no less.
When the memory of a guest is resized by default the
HPVMCHUNKSIZE value is used but a per-VM chunk size can also be set. To do so use the
As in the system-wide parameter the recommendation is to set the chunk size to a multiple of the dynamic memory chunks size.
Finally to display the configuration and the current use of the virtual machines resource entitlements use
I hope this helps to clarify how HPVM manage the memory of the virtual machines and how to customize its configuration. As always any comment would be welcome :-)