Hyper-V - VM Name Matches Computer Name Monitor

QND.Hyperv2012R2.VMName.Matches.ComputerName.Monitor (UnitMonitor)

This montior compares the Hyper-V virtual machine name with the VM's computer name. It raises alerts when the virtual machine name does not match the VM's computer name.

Knowledge Base article:

Summary

This montior compares the Hyper-V virtual machine name with the VM's computer name. It raises alerts when the virtual machine name does not match the VM's computer name.

Configuration

Generally speaking, when a VM is intially built, the virtual machine name would match the computer name. However, if later on the computer name has been changed in the Operating System on the VM, it may cause duplicate records for this computer in various System Center products such as OpsMgr and ConfigMgr. This monitor is designed to detect when the computer name configured on Operating System does not match the VM name and a warning alert is generated.

Resolutions

Rename the VM name to match the computer name. Review systems such as OpsMgr and ConfigMgr and remove the old obsolete agent / computer records.

Element properties:

TargetQND.Hyperv.2012R2.VM
Parent MonitorSystem.Health.ConfigurationState
CategoryConfigurationHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeQND.Hyperv2012R2.VMName.ComputerName.Match.MT
RemotableTrue
AccessibilityPublic
Alert Message
Hyper-V - Virtual machine name does not match the VM's computer name

The Hyper-V virtual machine name for {1} does not matche the VM's computer name.

VM Computer FQDN: {0}
VM Computer NetBIOS Name: {2}
RunAsDefault

Source Code:

<UnitMonitor ID="QND.Hyperv2012R2.VMName.Matches.ComputerName.Monitor" Accessibility="Public" Enabled="true" ConfirmDelivery="false" ParentMonitorID="Health!System.Health.ConfigurationState" Priority="Normal" Remotable="true" Target="QND.Hyperv.2012R2.VM" TypeID="QND.Hyperv2012R2.VMName.ComputerName.Match.MT">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="QND.Hyperv2012R2.VMName.Matches.ComputerName.Monitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="QND.Hyperv.2012R2.VM"]/VMComputerName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="QND.Hyperv.2012R2.VM"]/VirtualMachineName$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='NetBIOSName']$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="NamesMatch" MonitorTypeStateID="NamesMatch" HealthState="Success"/>
<OperationalState ID="NamesDoNotMatch" MonitorTypeStateID="NamesDoNotMatch" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>86400</IntervalSeconds>
<SyncTime/>
<ComputerFQDN>$Target/Property[Type="QND.Hyperv.2012R2.VM"]/VMComputerName$</ComputerFQDN>
<VMName>$Target/Property[Type="QND.Hyperv.2012R2.VM"]/VirtualMachineName$</VMName>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>