Storage Cluster CI not showing up in Devices table in Discovery Status page


Description

When doing a storage discovery, storage cluster doesn't show up in Devices (discovery_device_history) table.

The issue is due to a parameter called g_device which doesn't get updated while discovering storage cluster although the CI gets created in cmdb_ci_storage_cluster table.

In the Devices table the CI is displayed as (empty) and the class is displayed as Storage Server.


Steps to Reproduce

1. Run a Storage Cluster Discovery

2. Make sure that CI gets populated in cmdb_ci_storage_cluster table

3. Check the Devices table in Discovery Status page


Workaround

To fix this issue, Go to Script Include Horizontal Discovery Sensor (sys id - 2f32f7899f230200fe2ab0aec32e706a ) and replace lineĀ 

if (resultHandler.isPagingComplete()) {
// show that we were successful with this probe...
g_device.markScanned(this.getParameter('port_probe'));

with

if (resultHandler.isPagingComplete()) {
// show that we were successful with this probe...

if(!g_device.getCmdbCi()) {
var fullPayload = JSON.parse(discoveredJson);
fullPayload.items.forEach(function(item) {
if(item.values.ip_address == g_device.getSource() && item.className == "cmdb_ci_storage_cluster") {
var gr = new GlideRecord(item.className);
gr.addQuery("name",item.values.name);
gr.addQuery("serial_number",item.values.serial_number);
gr.query();
if(gr.next()) {
g_device.setCISysID(gr.getUniqueValue());
g_device.setClassifiedAs(item.className);
}
}
});
}

g_device.markScanned(this.getParameter('port_probe'));