Summary
This article aims to explain how the virtual machine (VM) instance and the host VM are related during discovery.
Release
All releases
Instructions
Cloud discovery finds resources in Amazon Web Services (AWS) and Microsoft Azure clouds, and then populates the configuration management database (CMDB) with the relevant configuration items (CI) and relationships.
When you discover a virtual machine in one of these cloud providers, two records are related to that virtual machine:
- One is called VM Instance; AWS calls it instance and Azure calls it a Virtual machine.
- The other record corresponds to the guest VM, also referred to as host VM or simply the OS Server.
Once a VM instance is discovered, a record is created in the cmdb_ci_vm_instance table. When configuring a cloud schedule to discover these VM instances, you can choose to automatically trigger discovery of the associated VM host. This is done by enabling the Discovery VMs by IP address (Recommended) option in the Discovery Manager.
Next, a second discovery schedule is created and is run after cloud discovery. For example, if the cloud discovery schedule name is Discover AWS, Discovery Manager creates a second schedule called Discover- VM schedule, which runs after the Discover AWS schedule.
Note: With this configuration option, no IP Ranges will exist in the Discover- VM schedule schedule. If you are manually creating a schedule to discover the host VM, then the IP Range must be supplied.
After both discoveries complete, the system creates:
- A VM instance [cmdb_ci_vm_instance]
- A host VM record depending on the VM operating system, either [cmdb_ci_win_server] (Windows) or [cmdb_ci_linux_server] (Linux)
A relationship between the VM instance and VM host is also created in the relationship table [cmdb_rel_ci] with the type Virtualized by::Virtualizes; that is, Linux Server Virtualized by::Virtualizes "Virtual Machine Instance" in the case of a Linux server.
When using Linux Server or Windows OS - Servers patterns for discovery of the host VM, the Create Relation Between Host To VM Instance pattern post-sensor script creates this relationship.
Once the host VM is created or updated in the CMDB, the Virtual Computer Check business rule marks this OS Server as being a virtual machine by flagging the virtual field as true.
Possible solutions for undiscoverable host VMs
1. Discovered VMs do not have public IPs; therefore no IPs are input for IP Schedule to scan and discover.
Possible solution: Have the public IP associated with the VM and verify that they are reachable from the MID Server via a simple ping test.
2. Public IPs are available but not reachable by the MID Server or MID Cluster selected.
Possible solution: Check where the MID Server is located and if the host is reachable via a simple ping test.
3. Public IPs are available, the host is reachable to the VM, but no credentials are available. The discovery status stops at the Classification stage only.
Possible solution: Ensure the credentials are created in the ServiceNow instance.
4. Public IPs are available, the host is reachable to the VM, but ports aren't configured properly. The discovery status stops at the Shazzam stage only.
Possible solution: Check that the ports of the hosts are properly configured.
5. During the IP schedule, a few public IPs are considered but not others
Possible solution: Run the IP discovery only on the active VMs. Check that the VM state is on, but not retired or terminated.
Possible solution: The VMs are discovered in the first run and subsequently found as retired. Therefore IP discovery is not triggered for the retired VMs.