48 views

Overview


As part of discovery, a configuration item (CI) may have its IP address updated. This KB focuses on explaining the steps followed by the discovery logic in order to update such IP address.

Note: The focus of this article is the field ip_address of a discovered CI, such as cmdb_ci_computer.ip_address. When a CI is discovered, the table cmdb_ci_ip_address is also populated with the IP addresses found for the CI.

Discovered CI IP Address


The IP Address for a CI is set during the identification phase of discovery.

PROBES/SENSORS:

At the identification phase, a payload called cidata is passed to the identification and reconciliation engine (IRE). The IRE uses such cidata to Create/Update the CI. The CI's IP address will be updated if the ip_address in the cidata is not the same as the currently set IP address for the CI.

The IP address in the cidata is the same IP address being used to discover the CI.

In most cases, it is not desirable to have the IP address changing with each discovery. Therefore, before passing the payload to the IRE, discovery attempt to determine whether to remove the ip_address from the payload. Removing the ip_address from the payload would ensure that the IP address for the CI is not updated.

The script include DiscoveryJSONIDSensor uses the function processIPAddressField(ciRecord) to performs the following steps:

  1. Check if the identification engine found a matching CI. If no CI was found based on the cidata, this is the first time the device is discovered. Use IP address from cidata to update CI.
  2. Check if the existing CI does not have an IP address. Use IP address from cidata to update CI.
  3. Check if the CI current IP address matches the cidata IP address. If yes, nothing needs to be done. The CI will maintain the IP address
  4. At this point we have an IP address in the cidata which does not match the CI current IP address. Leaving this IP address in the cidata would cause the CI IP address to be updated. The identification phase also collects the network adapters. Check if the CI current IP address is one of the IP addresses discovered with the network cards. If yes, then this is still a valid IP address and we may keep it. Therefore, clear the cidata IP address so that the CI current IP address is not updated.

PATTERNS:

Patterns do not use DiscoveryJSONIDSensor. The ip_address for a CI will come from $computer_system.managementIP. Each pattern will have a step where $<class_name>[].ip_address is set to $computer_system.managementIP. $computer_system is a global pattern variable(Pattern Variables). Steps can be added to the pattern or removed to control what IP address should be used.

POST DISCOVERY:

Once discovery completes for a CI, a discovery.device.complete event is created. The script action which responds to this event calls script include IPAddressFixup. IPAddressFixup is controlled by the following properties:

  1. glide.discovery.enforce_ip_sync
  2. glide.discovery.exclude_ip_sync_classes
  3. glide.discovery.enforce_unique_ips

Discovery Properties


glide.discovery.enforce_ip_sync:

  • Prevents the system from using a discovered IP address in the CI record if the address doesn't match that of a NIC on the device. If this property is true, Discovery checks the IP address returned to determine if it is associated with a NIC on the device. If the address is not associated with a NIC, Discovery uses the IP address from one of the NICs instead. The IP address used will be the first found in the list of IP addresses belonging to the CI, the IP address will be ordered by the ip_address column. 

glide.discovery.exclude_ip_sync_classes:

  • Defines CI classes whose IP addresses should not be substituted if the address returned by Discovery does not match one of the devices' NICs. Use a comma separated list to define multiple classes. By default, the system uses the management IP of a load balancer returned by Discovery in the CI record, rather than substituting it for the IP address of one of the load balancer's NICs.

glide.discovery.enforce_unique_ips:

  • Each time a computer, printer, or network gear is discovered, and that device has a valid IP address, then any other devices with the same IP address have their IP address field cleared.

 

Article Information

Last Updated:2018-10-02 13:16:14
Published:2018-10-02