System Center 2019+ Virtual Machine Manager ホストの親パーティションの CPU 使用率

Microsoft.SystemCenter.VirtualMachineManager.HostParentPartitionCPUUtilizationMonitor (UnitMonitor)

親パーティションの CPU 使用率を監視します

Knowledge Base article:

概要

このモニターは、ホストの CPU パフォーマンスを追跡します。CPU 使用率がしきい値を超えています。

原因

ホストで動作しているバーチャル マシンと親パーティションの作業負荷による、ホストの CPU リソースの使用率が重大レベルに達しています。

解決方法

バーチャル マシンを別のホストに移行するか、親パーティションの作業負荷による CPU 使用率を下げます。Virtual Machine Manager で自動的にホスト クラスターの負荷を分散させるには、動的最適化を有効にします。動的最適化の詳細については、Virtual Machine Manager のドキュメントを参照してください。

Element properties:

TargetMicrosoft.SystemCenter.VirtualMachineManager.Discovery.HyperVHost
Parent MonitorSystem.Health.AvailabilityState
CategoryCustom
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.VirtualMachineManager.Performance.PowershellBasedConsecutiveSamplesTwoThresholdsMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
ホストの親パーティションの CPU 使用率が高くなっています
親パーティションの CPU 使用率 {1} は、{0} の警告レベルまたは重大レベルを超えています
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.VirtualMachineManager.HostParentPartitionCPUUtilizationMonitor" Accessibility="Public" Target="VMMDiscovery!Microsoft.SystemCenter.VirtualMachineManager.Discovery.HyperVHost" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" TypeID="Microsoft.SystemCenter.VirtualMachineManager.Performance.PowershellBasedConsecutiveSamplesTwoThresholdsMonitorType">
<Category>Custom</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.VirtualMachineManager.HostParentPartitionCPUUtilizationMonitor.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="CPUUtilizationReachedWarning" MonitorTypeStateID="ConditionWarn" HealthState="Warning"/>
<OperationalState ID="CPUUtilizationReachedError" MonitorTypeStateID="ConditionError" HealthState="Error"/>
<OperationalState ID="CPUUtilizationIsSuccess" MonitorTypeStateID="ConditionSuccess" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>180</IntervalSeconds>
<TimeoutSeconds>180</TimeoutSeconds>
<WarningThreshold>80</WarningThreshold>
<CriticalThreshold>90</CriticalThreshold>
<NumSamples>3</NumSamples>
<hostComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</hostComputerName>
<ScriptBody><Script> # This Script is used to check the Host Parent partition CPU utilization
# Alert when the utilization of this partition is high:
# Warning: WarningThreshold%, like 80%
# Critical: CriticalThreshold, like 90%
#SetLocale("en-us")
param($HostComputerName)

$momApi = new-Object -comObject "Mom.ScriptAPI"
$momBag = $momApi.CreatePropertyBag()

if ($HostComputerName -ne $null)
{
Load-CimModules

$hostName=$HostComputerName
$cimSessionOption = New-CimSessionOption -Protocol DCOM
$cimsession = New-CimSession -ComputerName $hostName -SessionOption $cimSessionOption
$itemsPerfFormattedData_Perfos_Processor = Get-CimInstance -CimSession $cimsession -ClassName "win32_PerfFormattedData_Perfos_Processor" -Namespace "root\cimv2" -Filter "Name='_Total'"
ForEach ($item in $itemsPerfFormattedData_Perfos_Processor)
{
$performanceUtilization= $item.PercentProcessorTime
}
$performanceUtilization = [int]($performanceUtilization)
$momBag.AddValue("Utilization", $performanceUtilization)
$momBag
}
else
{
$momAPI.LogScriptEvent("HostParentCPUUtilizationCounter.ps1", 101, 0, "HostParentCPUUtilizationCounter was not called with 1 argument and was not executed.")
}

Function Load-CimModules
{
$error.Clear()

$CimModule = Get-Module CimCmdlets

if ($null -eq $CimModule)
{
Import-Module CimCmdlets
$error.Clear()
}
}

</Script></ScriptBody>
<ObjectName>win32_PerfFormattedData_Perfos_Processor</ObjectName>
<CounterName>PercentProcessorTime</CounterName>
<InstanceName>_Total</InstanceName>
<Value>$Data/Property[@Name='Utilization']$</Value>
</Configuration>
</UnitMonitor>