VMWare Virtual Machine Instance Discovery - Duplicates

Tom104
Tera Expert

Hi,

We're experiencing an issue in our ServiceNow Instance (Tokyo) whereby multiple Virtual Machine Instances are being discovered with the same name as separate CI records.

 

e.g. we have 5 instances of V-P1XXXXX and 5 of V-P2XXXXX

 

I can't understand why Discovery isn't simply noticing the instance has been shut down and then requested again, as such just coalescing all the V-P1XXXXX entries into one singular CI Record.

 

Can anyone explain why this might be happening and detail actual remediation steps?

I really don't want to have to delete the old instance every single time a new one is requested.

 

Thanks in advance

2 REPLIES 2

Amit Gujarathi
Giga Sage
Giga Sage

HI @Tom104 ,
I trust you are doing great.

The reason why Discovery is not automatically noticing that the instance has been shut down and requested again is due to the default behavior of the discovery process in ServiceNow. By design, Discovery treats each instance as a separate configuration item (CI) record, even if they have the same name.

To resolve this issue and consolidate the multiple CI records into a single one, you can follow these remediation steps:

  1. Identify the root cause: Verify if the instances are indeed being shut down and requested again. Ensure that the shutdown and request process is working as expected.

  2. Update the identification rules: Modify the identification rules used by the Discovery process to include additional criteria for determining uniqueness. You can add attributes such as IP address, MAC address, or other unique identifiers specific to your virtual machine instances.

 

var identificationRule = new GlideDiscoveryIdentificationRule();
identificationRule.setType("script");
identificationRule.setScript("current.name == discovery_device.name && current.ip_address == discovery_device.ip_address");
identificationRule.update();

 

  • The above code snippet demonstrates how to add a script-based identification rule that compares the name and IP address of the discovered instance with the existing CI record.

  • Run Discovery again: Once you have updated the identification rules, trigger the Discovery process again to rediscover the virtual machine instances. This will allow Discovery to recognize and consolidate the instances with the same name into a single CI record based on the additional identification criteria.

  •  

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Hi Amit,

No information is really collected for the instances, barring name and IP.

The IP however is dynamic and changes each time the instance is requested.

All I require is a match on the instance name, overwrite existing attributes, i.e. IP address with the most recent discovery and not create a second record.

 

Can you explain how to do this/update the Identification rules to achieve this?