System Center 2012 Virtual Machine Manager Host Memory Utilization

Microsoft.SystemCenter.VirtualMachineManager.2012.HostMemoryUtilizationMonitor (UnitMonitor)

Monitors the host memory utilization

Knowledge Base article:

Summary

This monitor tracks how much memory on the host is being used, in megabytes. The available memory for the host is less than the threshold.

Causes

The virtual machines running on the host are consuming critical levels of host memory.

Resolutions

To free additional host memory, migrate a virtual machine to another host. To have Virtual Machine Manager automatically load-balance host clusters, enable the dynamic optimization feature. For information about dynamic optimization, see the Virtual Machine Manager documentation.

Element properties:

TargetMicrosoft.SystemCenter.VirtualMachineManager.2012.HyperVHost
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.VirtualMachineManager.2012.Performance.ScriptBasedConsecutiveSamplesTwoThresholdsMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
Host Memory Utilization is high
Host memory utilization is {1} and has exceeded the warning or critical levels for {0}
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.VirtualMachineManager.2012.HostMemoryUtilizationMonitor" Accessibility="Public" Target="VMM2012Discovery!Microsoft.SystemCenter.VirtualMachineManager.2012.HyperVHost" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" TypeID="Microsoft.SystemCenter.VirtualMachineManager.2012.Performance.ScriptBasedConsecutiveSamplesTwoThresholdsMonitorType">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.VirtualMachineManager.2012.HostMemoryUtilizationMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Data/Context/SampleValue$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="MemoryUtilizationReachedWarning" MonitorTypeStateID="ConditionWarn" HealthState="Warning"/>
<OperationalState ID="MemoryUtilizationReachedError" MonitorTypeStateID="ConditionError" HealthState="Error"/>
<OperationalState ID="MemoryUtilizationIsSuccess" MonitorTypeStateID="ConditionSuccess" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>180</IntervalSeconds>
<TimeoutSeconds>180</TimeoutSeconds>
<WarningThreshold>80</WarningThreshold>
<CriticalThreshold>90</CriticalThreshold>
<NumSamples>3</NumSamples>
<Arguments>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</Arguments>
<ScriptBody><Script>
' Copyright (c) Microsoft Corporation. All rights reserved.
' VBScript source code
' HostMemoryUtilizationCounter.vbs
Option Explicit

SetLocale("en-us")

' This Script is used to check the Host memory utilization
' Alert when the utilization of this partition is high:
' Warning: WarningThreshold%, like 80%
' Critical: CriticalThreshold, like 90%
Dim oArgs, hostComputerName, objWMIService, colItems, objItem, performanceUtilization
Dim oAPI, oBag

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oArgs = Wscript.Arguments

' Check to see if the required script arguments are there
' 1 argument is requried
' If 1 argument does not exist, log a script event
If oArgs.Count = 1 Then
hostComputerName = oArgs(0)
Set oBag = oAPI.CreatePropertyBag()
Set objWMIService = GetObject("winmgmts:\\" &amp; hostComputerName &amp; "\root\CIMV2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
for each objItem in colItems
If objItem.TotalVisibleMemorySize &gt; 0 Then
performanceUtilization = ((objItem.TotalVisibleMemorySize - objItem.FreePhysicalMemory)/objItem.TotalVisibleMemorySize)*100
End If
Next

if performanceUtilization &lt; 0 then
performanceUtilization = 0
end if

performanceUtilization = CInt(performanceUtilization)

Call oBag.AddValue("Utilization", performanceUtilization)
Call oAPI.LogScriptEvent("HostMemoryUtilizationCounter.vbs", 103, 0, "HostMemoryUtilizationCounter is " &amp; performanceUtilization)

Call oAPI.Return(oBag)
Else
Call oAPI.LogScriptEvent("HostMemoryUtilizationCounter.vbs", 101, 0, "HostMemoryUtilizationCounter was not called with 1 argument and was not executed.")
End If
</Script></ScriptBody>
<ObjectName>win32_PerfFormattedData_Perfos_Memory</ObjectName>
<CounterName>PercentCommittedBytesInUse</CounterName>
<InstanceName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</InstanceName>
<Value>$Data/Property[@Name='Utilization']$</Value>
</Configuration>
</UnitMonitor>