4.15 HostMemoryUsage

Use this Knowledge Script to monitor the following memory metrics for a host:

  • Memory active - Sum of active memory for all powered-on virtual machines plus vSphere services (such as COS, vpxa) on the host.

  • Memory balloon - Sum of memory balloon of all powered-on virtual machines and vSphere services on the host. If the balloon target value is greater than the balloon value, the VMkernel inflates the balloon, causing more virtual machine memory to be reclaimed. If the balloon target value is less than the balloon value, the VMkernel deflates the balloon, which allows the virtual machine to consume additional memory if needed.

  • Memory granted - Sum of granted memory for all powered-on virtual machines, plus machine memory for vSphere services on the host.

  • Memory overhead - Total of all overhead memory for powered-on virtual machines, plus the overhead of running vSphere services on the host.

  • Memory reserved - Amount of memory (in kilobytes) that has been reserved, in particular for resource pools and virtual machines.

  • Memory shared - Sum of shared memory for all powered-on virtual machines, plus amount for vSphere services on the host. The host’s shared memory may be larger than the amount of machine memory if memory is overcommitted (the aggregate virtual machine configured memory is much greater than machine memory). The value of this statistic reflects how effective transparent page sharing and memory over-commitment are for saving machine memory.

  • Memory shared common - Amount of machine memory that is shared by all powered-on virtual machines and vSphere services on the host. Subtract this metric from the shared metric to gauge how much machine memory is saved due to sharing.

  • Memory state - Amount of free machine memory on the host. The VMkernel has four free-memory thresholds that affect memory reclamation:

    • 0 (high) Free memory ≥ 6% of machine memory minus Service Console memory

    • 1 (soft) 4%

    • 2 (hard) 2%

    • 3 (low) 1%

    • 0 (high) and 1 (soft): Swapping is favored over ballooning

    • 2 (hard) and 3 (low): Ballooning is favored over swapping

  • Memory swap in - Sum of swap in values for all powered-on virtual machines on the host.

  • Memory swap in rate - Rate at which memory is swapped from disk into active memory.

  • Memory swap out - Sum of swap out memory from all powered-on virtual machines on the host.

  • Memory swap out rate - Rate at which memory is being swapped from active memory to disk during the current interval. This counter applies to virtual machines and is generally more useful than the swap out counter to determine if the virtual machine is running slow due to swapping, especially when looking at real-time statistics.

  • Memory swap used - Sum of the memory swapped by all powered-on virtual machines on the host.

  • Memory unreserved - Amount of memory that is unreserved. Memory reservation not used by the Service Console, VMkernel, vSphere services and other powered-on virtual machines user-specified memory reservations and overhead memory. This statistic is no longer relevant to virtual machine admission control, as reservations are now handled through resource pools.

  • Memory usage - Percentage of available machine memory usage:

  • Memory zero - Sum of zero memory for all powered-on virtual machines, plus vSphere services on the host.

This script raises an event if a monitored metric exceeds the threshold you set.

NOTE:

  • When a host goes into maintenance mode all VirtualCenter_Host* Knowledge Scripts, except for the VirtualCenter_HostConnected Knowledge Script, suppress events and data.

  • In rare situations, queries to the ESX or ESXi host might fail with timeouts because the ESX or ESXi host stops responding. This issue affects all VirtualCenter_Host* Knowledge Scripts. You can work around this issue by restarting the management service on the ESX or ESXi host.

4.15.1 Resource Object

vSphere ESX or ESXi host

4.15.2 Default Schedule

By default, this script runs every 15 minutes.

4.15.3 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

General Settings

Job Failure Notification

Raise event when memory metrics are not available?

Select Yes to raise an event when memory metrics are not available. The default is Yes.

Event severity when memory metrics are not available

Set the event severity level, from 1 to 40, to indicate the importance of an event in which memory metrics are not available. The default is 15.

Event severity when AppManager failed to get metrics

Set the event severity level, from 1 to 40, to indicate the importance of an event in which AppManager failed to retrieve metrics from vCenter. The default is 15.

Event severity when AppManager failed to log in

Set the event severity level, from 1 to 40, to indicate the importance of an event in which AppManager failed to log in to vCenter. The default is 5.

Event severity when HostMemoryUsage job fails unexpectedly

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the HostMemoryUsage job fails unexpectedly. The default is 5.

Additional Settings

Event Details

Event detail format

Select either HTML Table or Plain Text as the format for event detail. The default is HTML Table.

Monitor Memory Active

Event Notification

Raise event when memory active exceeds the threshold?

Select Yes to raise an event when the memory active exceeds the threshold you set. The default is unselected.

Threshold -- Maximum memory active

Specify the maximum threshold for memory active that can be reached before an event is raised. The default is 20 percent.

Event severity when memory active exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when the active memory exceeds the threshold. The default is 15.

Data Collection

Collect data for memory active?

Select Yes to collect data about memory active for charts and reports. The default is unselected.

Monitoring Memory Balloon

Event Notification

Raise an event when memory balloon exceeds the threshold?

Select Yes to raise an event when host memory balloon exceeds the threshold you set. The default is Yes.

Threshold -- Maximum memory balloon

Specify the maximum threshold for memory balloon that can be reached before an event is raised. The default is 2 percent.

Event severity when memory balloon exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which host memory balloon exceeds the threshold. The default is 15.

Data Collection

Collect data for memory balloon?

Select Yes to collect data about host memory balloon for charts and reports. The default is unselected.

Monitor Memory Granted

Event Notification

Raise event when memory granted exceeds the threshold?

Select Yes to raise an event when the amount of memory granted exceeds the threshold you set. The default is unselected.

Threshold -- Maximum memory granted

Specify the maximum threshold for memory granted that can be reached before an event is raised. The default is 80 percent.

Event severity when memory granted exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the amount of memory granted exceeds the threshold. The default is 15.

Data Collection

Collect data for memory granted?

Select Yes to collect data about memory granted for charts and reports. The default is unselected.

Monitor Memory Overhead

Event Notification

Raise event when memory overhead exceeds the threshold?

Select Yes to raise an event when the amount of memory overhead exceeds the threshold you set. The default is unselected.

Threshold -- Maximum for memory overhead

Specify the maximum threshold for memory overhead that can be reached before an event is raised. The default is 512 megabytes.

Event severity when memory overhead exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the amount of memory overhead exceeds the threshold. The default is 15.

Data Collection

Collect data for memory overhead?

Select Yes to collect data about memory overhead for charts and reports. The default is unselected.

Memory Reserved Capacity

Event Notification

Raise event when memory reserved capacity exceeds the threshold?

Select Yes to raise an event when memory reserved capacity exceeds the threshold you set. The default is unselected.

Threshold -- Maximum for memory reserved capacity

Specify the maximum threshold for memory reserved capacity that can be reached before an event is raised. The default is 80 percent.

Event severity when memory reserved capacity exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which host memory reserved capacity exceeds the threshold. The default is 15.

Data Collection

Collect data for memory reserved capacity?

Select Yes to collect data about memory reserved capacity for charts and reports. The default is unselected.

Monitor Memory Shared

Event Notification

Raise event when memory shared falls below the threshold?

Select Yes to raise an event when memory shared falls below the threshold you set. The default is unselected.

Threshold -- Minimum for memory shared

Specify the minimum threshold for memory shared that can be reached before an event is raised. The default is 512 megabytes.

Event severity when memory shared falls below the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which memory shared falls below the threshold. The default is 15.

Data Collection

Collect data for memory shared?

Select Yes to collect data about memory shared for charts and reports. The default is unselected.

Monitor Memory Shared Common

Event Notification

Raise event when memory shared common falls below the threshold?

Select Yes to raise an event when memory shared common falls below the threshold you set. The default is unselected.

Threshold -- Minimum for memory shared common

Specify the minimum threshold for memory shared common that can be reached before an event is raised. The default is 256 megabytes.

Event severity when memory shared common falls below the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which memory shared common falls below the threshold. The default is 15.

Data Collection

Collect data for memory shared common?

Select Yes to collect data about memory shared common for charts and reports. The default is unselected.

Monitor Memory State

Event Notification

Raise event when memory state is hard?

Select Yes to raise an event when memory state is hard. The default is unselected.

Event severity when memory state is hard

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the memory state is hard. The default is 10.

Raise event when memory state is high?

Select Yes to raise an event when memory state is high. The default is unselected.

Event severity when memory state is high

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the memory state is high. The default is 25.

Raise event when memory state is low?

Select Yes to raise an event when memory state is low. The default is unselected.

Event severity when memory state is low

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the memory state is low. The default is 5.

Raise event when memory state is soft?

Select Yes to raise an event when memory state is soft. The default is unselected.

Event severity when memory state is soft

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the memory state is soft. The default is 15.

Data Collection

Collect data for memory state?

Select Yes to collect data about memory state for charts and reports. The default is unselected.

Monitor Memory Swap In

Event Notification

Raise event when memory swap in exceeds the threshold?

Select Yes to raise an event when memory swap in exceeds the threshold you set. The default is unselected.

Threshold -- Maximum for memory swap in rate

Specify the maximum threshold for memory swap in rate that can be reached before an event is raised. The default is 512 megabytes.

Event severity when memory swap in exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which host memory swap in exceeds the threshold. The default is 15.

Data Collection

Collect data for memory swap in?

Select Yes to collect data about memory swap in for charts and reports. The default is unselected.

Monitor Memory Swap In Rate

Event Notification

Raise event when memory swap in rate exceeds the threshold?

Select Yes to raise an event when memory swap rate in exceeds the threshold you set. The default is Yes.

Threshold -- Maximum for memory swap in rate

Specify the maximum threshold for memory swap in rate that can be reached before an event is raised. The default is 1 megabyte per second.

Event severity when memory swap in rate exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which host memory swap in rate exceeds the threshold. The default is 15.

Data Collection

Collect data for memory swap in rate?

Select Yes to collect data about memory swap in rate for charts and reports. The default is unselected.

Monitor Memory Swap Out

Event Notification

Raise event when memory swap out exceeds the threshold?

Select Yes to raise an event when memory swap out exceeds the threshold you set. The default is unselected.

Threshold -- Maximum for memory swap out

Specify the maximum threshold for memory swap out that can be reached before an event is raised. The default is 256 megabytes.

Event severity when memory swap out exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which host memory swap out exceeds the threshold. The default is 15.

Data Collection

Collect data for memory swap out?

Select Yes to collect data about memory swap out for charts and reports. The default is unselected.

Monitor Memory Swap Out Rate

Event Notification

Raise event when memory swap out rate exceeds the threshold?

Select Yes to raise an event when memory swap out rate exceeds the threshold you set. The default is Yes.

Threshold -- Maximum for memory swap out rate

Specify the maximum threshold for memory swap out rate that can be reached before an event is raised. The default is 1 megabyte per second.

Event severity when memory swap out rate exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which memory swap out rate exceeds the threshold. The default is 15.

Data Collection

Collect data for memory swap out rate?

Select Yes to collect data about memory swap out rate for charts and reports. The default is unselected.

Monitor Memory Swap Used

Event Notification

Raise event when memory swap used exceeds the threshold?

Select Yes to raise an event when memory swap used exceeds the threshold you set. The default is Yes.

Threshold -- Maximum for memory swap used

Specify the maximum threshold for memory swap used that can be reached before an event is raised. The default is 2.

Event severity when memory swap used exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which memory swap used exceeds the threshold. The default is 15.

Data Collection

Collect data for memory swap used?

Select Yes to collect data about memory swap used for charts and reports. The default is unselected.

Monitor Memory Unreserved

Event Notification

Raise event when memory unreserved exceeds the threshold?

Select Yes to raise an event when memory unreserved exceeds the threshold you set. The default is unselected.

Threshold -- Maximum for memory unreserved

Specify the maximum threshold for memory unreserved that can be reached before an event is raised. The default is 80 percent.

Event severity when memory unreserved exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which host memory unreserved exceeds the threshold. The default is 15.

Data Collection

Collect data for memory unreserved?

Select Yes to collect data about memory unreserved for charts and reports. The default is unselected.

Monitor Memory Usage

Event Notification

Raise event when memory usage exceeds the threshold?

Select Yes to raise an event when memory usage exceeds the threshold you set. The default is Yes.

Threshold -- Maximum for memory usage

Specify the maximum threshold for memory usage that can be reached before an event is raised. The default is 80 percent.

Event severity when memory usage exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which host memory usage exceeds the threshold. The default is 15.

Data Collection

Collect data for memory usage?

Select Yes to collect data about memory usage for charts and reports. The default is unselected.

Monitor Memory Usage by VMKernel

Event Notification

Raise event when memory usage by VMkernel exceeds the threshold?

Select Yes to raise an event when memory usage by VMkernel exceeds the threshold you set. The default is unselected.

Threshold -- Maximum for memory usage by VMkernel

Specify the maximum threshold for memory usage by VMkernel that can be reached before an event is raised. The default is 256 megabytes.

Event severity when memory usage by VMkernel exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which memory usage by VMkernel exceeds the threshold. The default is 15.

Data Collection

Collect data for memory usage by VMkernel?

Select Yes to collect data about memory usage for VMkernel for charts and reports. The default is unselected.

Monitor Memory Zero

Event Notification

Raise event when memory zero exceeds the threshold?

Select Yes to raise an event when memory zero exceeds the threshold you set. The default is unselected.

Threshold - Maximum for memory zero

Specify the maximum threshold for memory zero that can be reached before an event is raised. The default is 20 percent.

Event severity when memory zero exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which memory zero exceeds the threshold. The default is 15.

Data Collection

Collect data for memory zero?

Select Yes to collect data about memory zero for charts and reports. The default is unselected.