Discovery Device IP AddressIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #7057C7; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } During discovery, a configuration item (CI) may have its IP address updated. This article focuses on the ip_address field of a discovered CI, such as cmdb_ci_computer.ip_address. When a CI is discovered, the cmdb_ci_ip_address table is also populated with the IP addresses discovered for the CI. The following steps show the discovery logic used to update such an IP address. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #7057C7; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } All releases Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #7057C7; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } Discovered CI IP Address The IP address for a CI is set during the identification phase of discovery. Probes and sensors At the identification phase, a payload called cidata is passed to the Identification and Reconciliation Engine (IRE). The IRE uses the cidata payload to create or update the CI. The IP address for the CI is updated if the ip_address in the cidata is not the same as the IP address currently set 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 attempts to determine whether to remove the ip_address from the payload. Removing the ip_address from the payload ensures that the IP address for the CI is not updated. The script include DiscoveryJSONIDSensor uses the function processIPAddressField(ciRecord) to perform the following steps: Did the identification engine find a matching CI? No: This is the first time the device is discovered. Uses the IP address from cidataYes: Continue Does the existing CI have an IP address? No: Uses the IP address from cidata to update CIYes: Continue Does the CI current IP address match the cidata IP address? No: ContinueYes: No need to remove the IP from the cidata. The CI maintains the IP address At this point, the IP address in the cidata does not match the CI current IP address. Leaving this IP address in the cidata would cause the CI IP address to be updated or flipped. The identification phase also collects the network adapters. Therefore, is the CI current IP address is one of the IP addresses discovered with the network cards? Yes: This is still a valid IP address and it can be kept. Therefore, clear the cidata IP address so that the CI current IP address is not updated unnecessarily.No: The CI record has an IP address which is no longer valid. Keep the IP address in the cidata so that the CI record is updated Patterns Patterns do not use the DiscoveryJSONIDSensor script include. The ip_address for a CI is set according to the logic in the pattern. Each pattern has a step where $<class_name>[].ip_address is set. Steps can be added to the pattern or removed to control what IP address should be used to update the ip_address field. Before Orlando Patch 5 CIs discovered via patterns have their ip_address updated according to what is returned for the ip_address field. The ip_address field is updated each time a CI is discovered via different IP addresses. Extra logic was added to the Horizontal Discovery Sensor to prevent this flipping in PRB1343838. Beginning with Orlando Patch 5 The preventFlappingAttributeOnParentClassReturnIreTime() function was added to the discovery sensor (PRB1343838). This function checks if the ip_address field is already populated on the CI and if so does not update it. However, this keeps the IP address field from changing at all if it is already populated. The IP address field needs to be updated manually and the CI will keep the updated value (discovery will no longer update it). PRB1443223 fixes this in Rome. Rome release PRB1443223 added logic to check if the current IP address for the CI is still being discovered. If not, replace it with the new IP address discovered for the CI. This is similar to what was done with probes. Post-discovery Once discovery completes for a CI, a discovery.device.complete event is created. The script action that responds to this event calls the IPAddressFixup script include. This script is controlled by the following properties: glide.discovery.enforce_ip_syncglide.discovery.exclude_ip_sync_classesglide.discovery.enforce_unique_ips Note: Post-discovery can update the ip_address field for both probes and pattern- based discovery. Discovery Properties glide.discovery.enforce_ip_sync The glide.discovery.enforce_ip_sync property 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 is the first found in the list of IP addresses belonging to the CI. The IP address is ordered by the ip_address column. glide.discovery.exclude_ip_sync_classes The glide.discovery.exclude_ip_sync_classes property 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 The glide.discovery.enforce_unique_ips property ensures that each time a computer, printer, or network gear is discovered, and that device has a valid IP address, any other devices with the same IP address have their IP address field cleared. Common issues CI IP address field updated after discovery completion by a system account This is usually due to the glide.discovery.enforce_ip_sync system property set to true. This triggers code in the IPAddressFixup script include that updates the IP address. Setting glide.discovery.enforce_ip_sync to false should stop this behavior. Alternatively, you can add the CI class to the glide.discovery.exclude_ip_sync_classes system property. IP Address updated each time discovery runs after migrating from probes to patterns Prior to Orlando Patch 5, this is expected behavior. A custom script action triggered by the discovery.device.complete event could be put in place to add custom logic on how to update the IP address, or a sa_pattern_prepost_script could perform this action. IP Address not updated by discovery after migrating from probes to patterns Beginning with Orlando Patch 5, the ip_address field is no longer updated if it is not empty. You can clear the ip_address field in a CI and then rediscover it so that discovery populates it. Alternatively, a custom script action or sa_pattern_prepost_script could perform this action. The glide.discovery.enforce_ip_sync system property can also ensure that the IP address is updated to a valid/current value. This property is explained previously in this document. This issue is fixed in Rome via PRB1443223.