ESX Servers have been linked to the Location where the vCenter rather than the physical Location
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2023 02:11 AM
how can we have the correct physical location tied to the vCenter and ES
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2024 05:59 AM
Please find my solution blow:
Note that below solution does NOT apply to patterns only for probes and sensors (the old way of discovery)
The OOB functionality ties the discovered vCenter CIs to the location of the discovery schedule that discovers the vCenter. I struggled a lot to find an easy solution for this and in the end I ended up modifying the JsonCI() script include. Modifying the cidata object in DiscoverySensor, or in the script field of the sensor, did not help.
I then realized that each sensor has a script include named the same as the sensor. e.g.: VCenterVMsSensor() that processes VM related data. Here you can modify data prior updating the VM. The functions call the JsonCI script include in which the discoveryPreWrite() function you can see the OOB location logic:
if(changeLocation){
var newLocation = new MyScriptInclude().getLocationFromDiscovery(some parameters);
if(newLocation){location = newLocation;}
}
if (location)
gr.location = location;