Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Integrity Virtual Machines A.03.00: Installation, Configuration, and Administration > Chapter 9 Managing Guests

Dynamic Memory

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Integrity VM allows you to dynamically modify the memory that the virtual machine can use.

Normally, guests use a fixed amount of memory. That memory is allocated when the virtual machine is started and locked down so it cannot be paged or swapped. Once the memory is locked down, the VM Host cannot make it available to other virtual machines. Therefore, the VM Host supports a fixed number of virtual machines based on the amount of memory in the VM Host system and the number and size of the virtual machines.

Dynamic memory is an optional feature of Integrity VM that allows you to change the amount of physical memory in use by a virtual machine without rebooting the virtual machine. In this release of Integrity VM, dynamic memory is available on HP-UX guests only. In order to use dynamic memory, the guest must have the guest management software installed, as described in Section : “Installing the Guest Management Software”.

For example, this feature allows a guest that is a Servicegard 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.

To manage a guest's memory dynamically on the VM Host, see Section : “Managing Dynamic Memory from the VM Host”.

To manage a guest's memory dynamically on the guest, see Section : “Managing Dynamic Memory from the Guest”.

Managing Dynamic Memory from the VM Host

Manage dynamic memory on the VM Host using the —x option with the hpvmcreate, hpvmmodify, or hpvmclone command. The —x option associates a variety of configuration parameters with the guest, including dynamic memory and network management for the guests. For a complete list of —x keywords used for dynamic memory, see Table 9-4.

By default, dynamic memory is not enabled. To manage a guest's memory dynamically, enter the hpvmcreate, hpvmmodify, or hpvmclone command. Include the —x ram_dyn_type option. Specify either any or driver as the argument to the option. For example, to use any available dynamic memory support for the guest named compass1, enter the following command on the VM Host:

# hpvmmodify -P compass1 -x ram_dyn_type=any

Setting ram_dyn_type to any or driver enables the other dynamic memory configuration controls. The minimum (ram_dyn_min) and maximum (ram_dyn_max) values bound the value of ram_dyn_target_start. The value of ram_dyn_target_start is set to 2 GB.

Viewing Dynamic Memory on the VM Host

On the VM Host, dynamic memory software is included with Integrity VM. Dynamic memory parameters and status are displayed for each guest using the standard Integrity VM commands. For example, for the guest named compass1, the hpvmstatus command displays the following dynamic memory information:

# hpvmstatus -V -P compass1
.
.
.
[Dynamic Memory Information]
  Type                    : driver
  Minimum memory          : 1222 MB
  Target memory           : 2103 MB
  Maximum memory          : 6144 MB
  Current memory          : 2103 MB
  Comfortable minimum     : 2167 MB
  Boot memory             : 6135 MB
  Free memory             : 125 MB
  Available memory        : 286 MB
  Memory pressure         : 0
  Memory chunksize        : 65536 KB
  Driver Mode(s)          : STARTED ENABLED
.
.
.

Dynamic Memory Characteristics

Table 9-3 describes the dynamic memory characteristics displayed by the hpvmstatus and hpvmmgmt commands.

Table 9-3 Dynamic Memory Characteristics

CharacteristicSettingDescription
TypenoneNo dynamic memory support
 anyDynamic memory is configured on the host, but the dynamic memory subsystem on the guest has not started and reported the implementation type.
 driverDynamic memory is implemented in a driver and does not use Guest OS Online Add/Delete features.
 OLADDynamic memory is implemented using Guest OS Online Add/Delete features.
Minimum memoryvalueM (for megabytes) or valueG (for gigabytes)The lower bounds for ram_target and ram_dyn_target_start
Target memoryvalueM (for megabytes) or valueG (for gigabytes)The target memory size of the guest, set using ram_target or ram_dyn_target_start
Maximum memory valueM (for megabytes) or valueG (for gigabytes)The upper bounds for ram_target and ram_dyn_target_start
Current memoryvalueM (for megabytes) or valueG (for gigabytes)The current memory size of the guest (normally equal to target memory)
Comfortable minimumvalueM (for megabytes) or valueG (for gigabytes)A value for ram_target which can be used to reduce the guest memory but allow it sufficient memory resources to continue running a minimal workload.
Boot memoryvalueM (for megabytes) or valueG (for gigabytes)Size of physical memory in the virtual machine presented to the guest OS.
Free memoryvalueM (for megabytes) or valueG (for gigabytes)Amount of free memory in the guest
Available memoryvalueM (for megabytes) or valueG (for gigabytes)Amount of memory in the guest allocated by user processes but not locked. This memory is available for paging and can be made free.
Memory pressurevalueA value between 0 and 100 used an indicator of memory deficit and paging. The higher the number the longer the system has been in a memory deficit. A memory pressure value approaching 100 usually means the system is hung.
Memory chunk sizevalueThe allocation chunk size used by dynamic memory when increasing and descreasing guest memory (as described in “Specify Sufficient Guest Memory”).
Driver modestartedDynamic memory can change guest memory size.
 enabledControl that overrides started. Used by Online Guest Migration.
 guestctlGuest side control is enabled.

 

Modifying Guest Memory on the VM Host

A virtual machine can be configured to boot with a very small amount of memory, making the virtual machine available but maintaining a low overhead on the VM Host system. Because this operation takes place very early in the boot process, memory is not fragmented and the reduction in memory size succeeds.

A virtual machine memory size can be increased to any value between the minimum size (ram_dyn_min) and the maximum size (ram_dyn_max) in increments of the chunk size (64 Mb). You can use the —x option to the hpvmcreate, hpvmclone, and hpvmmodify commands to specify memory parameters. This command option accepts the keywords listed in Table 9-4.

Table 9-4 Dynamic Memory Control Command Options

Keyword Value PairDescription
dynamic_memory_control={1|0}Specifies whether a sufficiently privileged user on the guest (such as root) can change the dynamic memory values while the guest is running. To disable guest-side dynamic memory control, specify 0. If the guest is not active, the only effect is the modification of the guest configuration file. On the running guest, the change becomes effective immediately.
ram_dyn_type={none|any|driver}Specifies the type of dynamic memory control for the guest. When this configuration parameter is set to none, dynamic memory is disabled. This is the default setting. If your guest is running with dynamic memory enabled and you set this value to none, the guest configuration file is modified to remove all dynamic memory ranges and control information.

When this configuration parameter is set to any, the next boot of the guest determines whether or not dynamic memory is enabled on the guest. If the dynamic memory driver is loaded, the value of this parameter is changed to driver. If no drivers are loaded or found, the value is not changed.

When this configuration parameter is set to driver, guest dynamic memory controls and ranges are functional. Depending on the current or default settings, messages may be displayed indicating a resetting of the dynamic memory range values to match the current memory range settings. If you change the available guest memory value (using the -r option), the dynamic memory values are validated for range and modified.
ram_dyn_min=amountSpecifies the minimum amount of memory that can be dynamically allocated to the guest. The ram_dyn_min must be greater than the minimum memory (displayed by the hpvmstatus command) and less than the ram_dyn_max value.
ram_dyn_max=amountSpecifies the maximum amount of memory that can be dynamically allocated to the guest. The value of ram_dyn_max must be greater than the value ofram_dyn_min.
ram_dyn_target_start=amountSpecifies the amount of memory that the dynamic memory driver attempts to access when the guest starts. The value of the ram_dyn_target_start must be greater than the ram_dyn_min parameter and less than or equal to the ram_dyn_max parameter. When the guest starts, it initially has access to the guest memory size (specified by the -r option), then the dynamic memory driver reduces the memory to the value of the ram_dyn_target_start parameter.
ram_target={0|start|amount}Sets the current memory size for the guest. The ram_target keyword is valid on the hpvmmodify and hpvmmgmt commands only. When you specify 0 (zero), the dynamic memory driver reduces the memory on the guest to a comfortable minimum without forcing guest memory to be paged out. This minimum value changes over time as the guest's operating needs change. When you specify start, the guest dynamic memory size grows to the allocated value specified using the —r option. This parameter is dynamic and can only be used on an active guest.

 

You can supply several dynamic memory keywords on the same command line. For example, to enable dynamic memory and configure the guest named compass1 to reduce its size early in the boot process, enter the following command:

# hpvmmodify -P guest1 -r 6G \
 -x ram_dyn_type=any \
 -x ram_dyn_min=1222M \
 -x ram_dyn_max=6G \
 -x ram_dyn_target_start=2G

This command specifies the following values:

  • The virtual machine memory allocation is set to 6 GB.

  • Dynamic memory is enabled using any dynamic memory support available.

  • The minimum amount of memory that the virtual machine can use is 1222 MB.

  • The maximum amound of memory that the virtual machine can use is 6 GB (all the memory that is allocated to the guest)

  • The amount of memory to which the guest memory is reduced after it starts is 2G.

Managing Dynamic Memory from the Guest

Dynamic memory management from the guest must be enabled from the VM Host. To allow dynamic memory to be managed from the guest system, specify thehpvmcreate, hpvmmodify, or hpvmclone command, including the —x dynamic_memory_control option. Specify 1 as the argument to the option. For example, on the VM Host system, enter the following command to enable dynamic memory control on the guest named compass1:

# hpvmmodify -P compass1 -x dynamic_memory_control=1

The default is to not allow dynamic memory management from the guest.

You can use the hpvmmgmt command on the HP-UX guest to enable and control dynamic memory. This command is installed on the guest when you install the guest management software, as described in Section : “Installing HP-UX Guest Management Software”.

Table 9-5 decribes the options to the hpvmmgmt command.

Table 9-5 Options to the hpvmmgmt Command

-l typeSpecifies the type of data to list more information about. For type, enter ram.
-l type -t intervalAllows you to continually watch and check the dynamic ram values. For the interval, specify the number of seconds between fetches of live data.
-t intervalAllows the hpvmmgmt command to continuously refetch the requested type of data using the value specified for the interval parameter.
-vDisplays the version number of the hpvmmgmt command.
-VDisplays detailed information (verbose mode) about the virtual machines.
-MDisplays verbose attribute and resource information in a machine-readable format.
-XDisplays verbose attribute and resource information in the XML format.
-x ram_target={0 | start | amount}Specifies the guest RAM target, where:
  • 0 indicates the guest dynamic memory will be reduced to a comfortable minimum value.

  • start indicates the guest dynamic memory will be set back to the boot time value.

  • amount is a specific target memory size for the guest.

 

For example, on the guest, use the hpvmmgmt command to list the dynamic memory information. Enter the following command:

# hpvmmgmt -l ram

  [Dynamic Memory Information]
  =======================================
  Type                    : driver
  Current memory          : 6135 MB
  Target memory           : 6135 MB
  Comfortable minimum     : 2167 MB

To display more information, include the —V option. For example:

# hpvmmgmt -V -l ram
  [Dynamic Memory Information]
  =======================================
  Type                    : driver
  Current memory          : 2103 MB
  Target memory           : 2103 MB
  Comfortable minimum     : 2423 MB
  Minimum memory          : 1222 MB
  Maximum memory          : 6144 MB
  Boot memory             : 6135 MB
  Free memory             : 124 MB
  Available memory        : 286 MB
  Memory pressure         : 12
  Memory chunksize        : 65536 KB
  Driver Mode(s): STARTED ENABLED GUESTCTL

To modify the guest memory to 4 GB, enter the following command:

# hpvmmgmt -x ram_target=4096M
Attempting to increase memory from 2103 MB to 4096 MB.
Successfully began to change ram_target to 4096 MB.

Troubleshooting Dynamic Memory Problems

This section describes how to solve problems in the use of dynamic memory.

Dynamic Memory Restrictions

Use of dynamic memory is subject to the following restrictions:

  • The size of a virtual machine cannot be increased above its original boot size (as specified with the -r option).

  • If the virtual machine memory has become fragmented , attempting to reduce the size of the virtual machine may not succeed or may take a very long time. If you cannot reduce the size of the virtual machine to the desired size, abort the operation by setting a new target size.

  • Increasing the size of a virtual machine requires free memory on the VM Host. If the VM Host memory is insufficient, the operation may take a very long time to complete and may fail.

  • If the values of ram_target and ram_dyn_target_start are not inside the values of ram_dyn_min and ram_dyn_max, a warning is issued.

VM Host Performance Considerations

HP-UX supports “large pages”, a memory management feature used to improve performance. Integrity VM takes advantage of this feature by ensuring that when a virtual machine starts, it allocates the largest size pages that are available. Once these pages are allocated and locked down they cannot change size. This keeps fragmentation of large pages to a minimum.

This feature limits the types of software you can run on a VM Host system. If the VM Host system supports an additional workload beyond the virtual machines, the large pages tend to fragment and performance of the newly-started virtual machine may degrade.

Dynamic memory increases the possibility for VM Host memory to become fragmented. The current implementation of dynamic memory releases portions of the memory allocated to a virtual machine. These operations must be performed in large contiguous chunks; otherwise, the act of reducing the size of a virtual machine fragments the VM Host memory allocated to it. This potential fragmentation is prevented by the software, which reduces a vitual machine's size only in multiples of a minimum chunk size of 64 MB of physically contiguous memory. For more information, see Section : “Specify Sufficient Guest Memory”.

Guest Performance Considerations

During normal operation of a system which has a workload running on it, the large pages may become fragmented over time. This is true on the VM Host as well as a virtual machine running the HP-UX operating system. If the virtual machine's memory is fragmented, the dynamic memory subsystem will be unable to reduce the size of guest. This is due to the minimum chunk size used for the reduction. If dynamic memory cannot remove at least 64 MB of physically contiguous guest memory, no reduction in size takes place.

Specify Sufficient Guest Memory

If you set the value of ram_dyn_target_start too small, the guest operating system might hang or crash while booting. In this case, the guest does not have access to a sufficient amount of memory. As a rule, do not decrease the memory allocated to an HP-UX guest by more than 75% of its allocated memory size. Do not reduce the memory of a virtual machines configured with 2 GB of memory by more than 50%.

If the guest crashes while booting, on the VM Host , use the hpvmmodify command to increase the value of ram_dyn_target_start. For example, to increase the memory size for the guest named compass1, enter the following command on the VM Host:

# hpvmmodify -Pcompass1 -x ram_dyn_target_start=2G

After you set this parameter, reboot the guest.

If the guest hangs, on the VM Host, use the hpvmstatus command to check the memory statistics on the guest. For example:

# hpvmstatus -V -P compass1
.
.
.
[Dynamic Memory Information]
  Type                    : driver
  Minimum memory          : 1222 MB
  Target memory           : 2103 MB
  Maximum memory          : 6144 MB
  Current memory          : 2103 MB
  Comfortable minimum     : 2167 MB
  Boot memory             : 6135 MB
  Free memory             : 0 MB
  Available memory        : 286 MB
  Memory pressure         : 100
  Memory chunksize        : 65536 KB
  Driver Mode(s)          : STARTED ENABLED
.
.
.

An indication of this problem is a small or zero amount of free memory and a large memory pressure value (100). If these indicators are present, use the hpvmmodify command on the VM Host to increase the memory size of the guest . The guest should then boot normally.

Actual Memory Allocations May Differ

If you specify a value of ram_target or ram_dyn_target_start that results in a change in memory size that is not a multiple of 64 MB, the target value is reset.

For example, if you specify —r 6 GB, the HP-UX guest actually has access to 6135 MB of memory. If you modify the virtual machine, decreasing the amount of memory to 2048 MB, the amount of memory actually removed is 4087 MB. If you set the value of ram_target to 2048 MB, the value is reset to 2103 MB. Therefore, the actual amount of memory allocated is a multiple of the chunk size.

Enable Dynamic Memory on the Guest and on the VM Host

The guest management software must be installed on the guest before you can use dynamic memory parameters on the VM Host system. For example, if the guest management software is not installed, the hpvmstatus command displays the following:

# hpvmstatus -V -P guest0
.
.
.
[Dynamic Memory Information]
    NOTE: Dynamic data unavailable, configured values only
Type                    : driver
Minimum memory          : 1024 MB
Target memory           : 2048 MB
Maximum memory          : 3072 MB
.
.
.

If you attempt to modify the guest's dynamic memory from the VM Host, the following errors are displayed:

# hpvmmodify -x ram_target=2048M -P guest0

hpvmmodify: ERROR (guest0): Query to dynamic memory driver failed: Function is not available.
hpvmmodify: Failed to set ram_target.
hpvmmodify: Unable to modify the guest.

If you attempt to modify the dynamic memory from the guest, the following errors occur:

# hpvmmgmt -V -l ram
Dynamic memory driver not found on guest.
hpvmmgmt: Unable to continue.
# hpvmmgmt -x ram_target=2048
Failed to open dynamic memory driver, error: No such device.
Failed to set dynamic value error: No such device
hpvmmgmt: Unable to continue.

For information about enabling dynamic memory, see Section : “Enable Dynamic Memory on the Guest and on the VM Host”.

Upgrade the Guest Kit When Upgrading Integrity VM

The dynamic memory software has two components: the VM Host support and the HP-UX guest support. These two components must be at the same version level for dynamic memory to function. When you upgrade Integrity VM, you must also install the new guest kit on the guest. During this upgrade process, dynamic memory may not function.

If there is a version mismatch, a message is written to the VM Host's syslog when the guest starts. For example:

Mar 6 14:47:37 host vmunix: (hpvmdvr) Dynamic memory version mismatch Guest 5. 
Please update the guest kit

This example indicates that the guest management software kit on virtual machine number 5 is out of date. To determine which guest is number 5, use the hpvmstatus command. In the following example, guest 5 is named dale:

# hpvmstatus

Virtual Machine Name VM #  OS Type State     #VCPUs #Devs #Nets Memory  Runsysid
==================== ===== ======= ========= ====== ===== ===== ======= ========
chip                     1 HPUX    On (OS)        2     1     1    3 GB        0
dale                     5 HPUX    On (OS)        2     1     1    3 GB        0

For information about installing the HP-UX guest management software, see Section : “Installing HP-UX Guest Management Software”.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2007 Hewlett-Packard Development Company, L.P.