Využití procesoru nadřazeného oddílu hostitele nástroje System Center 2019+ Virtual Machine Manager

Microsoft.SystemCenter.VirtualMachineManager.HostParentPartitionCPUUtilizationMonitor (UnitMonitor)

Sleduje využití procesoru na nadřazeném oddíle.

Knowledge Base article:

Souhrn

Tento monitor sleduje výkon procesoru hostitele. Hodnota využití procesoru překročila prahovou hodnotu.

Příčiny

Virtuální počítače a zátěže nadřazených oddílů spuštěné v hostitelském počítači spotřebovávají kritickou úroveň prostředků procesoru hostitele.

Řešení

Proveďte migraci virtuálních počítačů do jiného hostitelského počítače nebo snižte spotřebu procesoru zátěže nadřazeného oddílu. Rovněž lze povolením dynamické optimalizace nechat nástroj Virtual Machine Manager, aby automaticky rozkládal zátěž clusterů hostitele. Další informace o dynamické optimalizaci získáte v dokumentaci k nástroji 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
Využití procesoru nadřazeného oddílu hostitele vysoké
Využití procesoru nadřazeného oddílu je {1} a překročilo úroveň upozornění nebo kritickou úroveň pro {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>