Hyper-V machines mistakenly categorized as physical by Discovery
ServiceNow offers the capability of discovering infrastructure hypervised by Microsofts Hyper-V technology. Although information is available through the product documentation topic Hyper-V data collected by Discovery, users of ServiceNow might find it unexpected that machines hosted by Hyper-V instances are still categorized as physical and not marked as virtual. This article explains how to determine whether a machine is virtual and how to ensure that Hyper-V machines are marked as virtual.
Determining whether a machine is virtual
The platform is using a set of business rules, sensor scripts, and built-in discovery logic in order to determine whether a computer should be considered virtual.
- When ServiceNow probes and sensors are retrieving basic information about the target machine(s) discovered, one vital piece of information is the serial key. For a complete list of the information retrieved upon discovery of Windows machines, refer to the product documentation topic Data collected by Discovery on Windows computers.
- Before a record is updated or inserted into the cmdb_ci_computer table, a business rule named Virtual computer check triggers.
- The Virtual computer check business rule includes logic that determines if the computer is virtual and, if so, which hypervisor technology is used (vmWare, Hyper-V, etc).
- The Virtual computer check business rule is responsible for setting the is virtual attribute on the CI record, as well as the relationship type. For example Virtualized by::Virtualizes or Registered on::Has registered.
Hyper-V machines not marked as virtual
In order for a Hyper-V hosted machine to be successfully classified as virtual, the following requirements need to be met:
- a corresponding Hyper-V server and/or instance
- a correct serial number on the CI record - the serial number needs to match any of the three serial number types listed below, on any of the Hyper-V instances
If you have not discovered the Hyper-V instance or server, or if it is missing any of the three serial numbers listed below, the machine(s) belonging to this instance will never be marked as virtual.
If the serial numbers on the Windows servers do not match any of the serial numbers on any of the Hyper-V instances, we do not have enough information to go any further in the Virtual computer check business rule. The code in DiscoveryHyperVSensor also attempts this, though in the other direction. Both pieces of code have this capability because we do not know which device will be discovered first and each will try to reconcile the dependencies.