|
» |
|
|
|
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. An example of 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. To use dynamic memory, the
guest must have the guest management software installed, as described
in Section . Managing Dynamic Memory from the VM Host | |
On the VM Host, the dynamic memory software is
included with Integrity VM. 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. Table 9-3 provides a complete list of -x keywords used for
dynamic memory. Table 9-3 Dynamic Memory Control Command Options Keyword Value Pair | Description |
---|
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 (zero). If the guest is not active,
the only effect is the modification of the guest configuration file.
On the running guest, the change takes effect 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 might 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=amount | Specifies the minimum amount of memory
that can be dynamically allocated to the guest. The ram_dyn_min value must be greater than the minimum
memory (displayed by the hpvmstatus command) and
less than the ram_dyn_max value. | ram_dyn_max=amount | Specifies 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=amount | Specifies 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 be used only on an active guest. |
Configuring a Virtual Machine to Use Dynamic MemoryBy default, dynamic memory is not enabled. To
configure a virtual machine to use dynamic memory, enter the hpvmcreate, hpvmmodify, or hpvmclone command. Include the following -x option to set initial values: -x ram_dyn_type = any | driver
-x ram_dyn_min = minimum size for memory size changes
-x ram_dyn_max = maximum size for memory size changes |
You can configure a virtual machine to reduce
its memory size early in a boot process, making the virtual machine
available but maintaining lower memory overhead on the VM Host system.
Use the following -x option to enable this feature: -x ram_dyn_target_start = memory size after boot |
You can supply several dynamic memory keywords
on the same command line. For example, to enable dynamic memory and
to configure the guest named compass1 to reduce its size early in
the boot process, enter the following command: # hpvmmodify -P compass1 -r 6G \
-x ram_dyn_type=any \
-x ran_dyn_min=1222M \
-x ram_dyn_max=6G \
-x ram_dyn_target_start=2G |
This command specifies the following values: The virtual machine memory size 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 be reduced to is 1222 MB. The maximum amount of memory that the virtual machine
can be increased to is 6 GB. The memory size to reduce to after it boots is 2 GB.
If the virtual machine is running when the dynamic
memory feature is configured for the first time, the virtual machine
must be rebooted for the configuration changes to take effect. Viewing Dynamic Memory on the VM HostDynamic 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 information about
dynamic memory: # 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
.
.
. |
Table 9-4 describes the dynamic memory characteristics displayed by the hpvmstatus and hpvmmgmt commands. Table 9-4 Dynamic Memory Characteristics Characteristic | Setting | Description |
---|
Type | none | No dynamic memory support | | any | Dynamic
memory is configured on the host, but the dynamic memory subsystem
on the guest has not started and reported the implementation type. | | driver | Dynamic memory is implemented in a driver and does not use Guest
OS Online Add/Delete features. | | OLAD | Dynamic
memory is implemented using Guest OS Online Add/Delete features. | Minimum memory | valueM (for megabytes) or valueG (for gigabytes) | The lower bounds for ram_target and ram_dyn_target_start. | Target memory | valueM (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 memory | valueM (for megabytes) or valueG (for gigabytes) | The current memory size
of the guest (normally equal to target memory). | Comfortable minimum | valueM (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 memory | valueM (for megabytes) or valueG (for gigabytes) | Size of physical memory
in the virtual machine presented to the guest OS. | Free memory | valueM (for megabytes) or valueG (for gigabytes) | Amount of free memory in
the guest. | Available memory | valueM (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. | Memory pressure | value | A value between 0 and 100 used as 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 chunksize | value | The allocation chunk size used by dynamic
memory when increasing and descreasing guest memory (as described
in Section . | Driver mode(s) | started | Dynamic memory can change guest memory size. | | enabled | Control that overrides started. | | guestctl | Guest-side control is enabled. |
Modifying a Virtual Machine's Memory Size on the VM HostOnce dynamic memory is configured, a virtual machine's
memory size can be changed 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). Use the following -x option to the hpvmmodify command to
change the memory size: # hpvmmodify -P compass1 -x ram_target = new memory size |
Managing Dynamic Memory from the Guest | |
Dynamic memory management from the guest is disabled
by default and must be enabled from the VM Host. If the feature is
not enabled, dynamic memory information can be displayed , but the
memory size cannot be changed. Use the hpvmcreate, hpvmmodify, or hpvmclone command and
include 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 |
|
Viewing Dynamic Memory Information from the GuestUse the hpvmmgmt command on
the HP-UX guest to manage and view the dynamic memory information.
This command is installed when you install the guest management software,
as described in Section . Table 9-5 describes the options to the hpvmmgmt command. Table 9-5 Options to the hpvmmgmt Command -l type | Specifies the type of data to list more information about.
For type, enter ram. | -l type -t interval | Allows
you to continually watch and check the dynamic ram values. For the interval, specify the number of seconds between fetches
of live data. | -t interval | Allows the hpvmmgmt command to continuously
refetch the requested type of data using the value specified for the interval parameter. | -v | Displays the version
number of the hpvmmgmt command. | -V | Displays detailed information
(verbose mode) about the virtual machines. | -M | Displays verbose attribute
and resource information in a machine-readable format. | -X | Displays 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 |
Modifying a Virtual Machine's Memory Size from the GuestOnce the dynamic memory feature is configured
and enabled, a virtual machine's memory size can be changed 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). Use the following-x option to the hpvmmgmt command: # hpvmmgmt -x ram_target=memory size |
For example, to change the guest memory size 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 RestrictionsUse 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 might fail or might 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 might take a very long time
to complete and might 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 Resource ConsiderationsHP-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 constraint minimizes fragmentation of large pages. 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 might degrade. Dynamic memory increases the possibility of VM
Host memory becoming 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 virtual machine's size in multiples
of a minimum chunk size of 64 MB of physically contiguous memory.
For more information, see Section and Section . Guest Resource ConsiderationsDuring normal operation of a system that has a
workload running on it, the large pages might 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 is 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 MemoryIf 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 the ram_dyn_target_start parameter.
For example, to increase the memory size for the guest named compass1, enter the following command on the VM
Host: # hpvmmodify -P compass1 -x ram_dyn_target_start=2GB |
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 then boots normally. Actual Memory Allocations Might DifferIf you specify a value for the ram_target or ram_dyn_target_start parameter 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 6 GB of memory, the
HP-UX guest actually has access to 6135 MB of memory. If you attempt
to set the memory size to 2048 MB, the amount of memory actually removed
is 4087 MB. This is not a multiple of 64 MB, so the target memory
size is reset to 2103 MB. Enable Dynamic Memory on the Guest and on the VM HostThe 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 compass1
.
.
.
[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 compass1
hpvmmodify: ERROR (compass1): 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 installing the guest management
software, see Section . Upgrade the Guest Kit When Upgrading Integrity VMThe 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. (You should also upgrade the guest operating system
if it is no longer supported.) 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 file (/var/adm/syslog/syslog.log) when the guest starts. For
example: 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 .
|