uimapi POST Device call to creates new Perspective overwrites primary role
search cancel

uimapi POST Device call to creates new Perspective overwrites primary role

book

Article ID: 407097

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

When using swagger to create Perspectives of Devices using the POST Call the primary role is overwritten with one of the roles passed in the XML Payload. 

The <primaryRole> Attribute is overwritten with the value <roles>example_custom_role</roles> and this causes that now metrics for cdm Probe are available anymore. 

Example payload used 

<?xml version="1.0" encoding="UTF-8"?>
<device>
<name>example_server</name>
<alias>example_server</alias>
<computerName>example_server</computerName>
<primaryOrigin>example_origin</primaryOrigin>
<roles>example_role</roles>
</device>

 

Why does this happen?

Environment

  • DX UIM 23.4.5 and earlier
  • uimapi 23.4.5 and earlier
  • discovery_server 23.4.5 and earlier

Cause

Defect in uimapi 23.4.5 discovery_server 23.4.5 and earlier where primary ROLE is overwitten by custom role added via API

Resolution

The 2 fixes attached to this case resolve the issue. 

Steps to apply the fix: 

1) Download uimapi 23.4.5.1 and discovery_server 23.4.5.2 and import to the archive

2) Deploy  uimapi 23.4.5.1 to the OC server

3) Deploy discovery_server 23.4.5.2 to the primary hub

 

IMPORTANT NOTE: 

With this fix in in place creating a device to a master device that is a "host" (Example: dedicated=host in cm_computer_sytem) the issue is resolved so it does not change the primary role which will be kept as HOST. 

However, creating a DEVICE via UIMAPI to a device that is not host (Example: dedicated=device) changes the primary host to HOST, which can cause issues. 



When adding a device to a device that is "dedicated = device" the following actions must be performed to obtain the same result you are getting when "dedicated = Host"

 

1. Remove <computerName> from the payload: Example: 


<?xml version="1.0" encoding="UTF-8"?>
<device>
<name>example_server</name>
<alias>example_server</alias>
<computerName>example_server</computerName>
<primaryOrigin>example_origin</primaryOrigin>
<roles>example_role</roles>
</device>



Note: you can use the following payload as basic one, in all device no matter if the device is (Host, Device, Router, VirtualMachine etc..) 


<?xml version="1.0" encoding="UTF-8"?>
<device>
<name>example_server</name>
<alias>example_server</alias>
<primaryOrigin>example_origin</primaryOrigin>
<roles>example_role</roles>
</device>

 

 

2. In order to avoid the discovery_server to correlate the new device to the master cs_id for dedicated = device, you also must enter the following correlation names rule. This is not invasive, and will only affect user_device devices in this particular scenario. 

 

in discoveryserver.cfg add: "user_device.label"

as below: 

  <correlation_names>
         included_probe_properties = "any.PrimaryDnsName,any.OtherDnsNames,controller.RobotName,any.SysName,any.VMName,any.ComputerName,niscache.label,user_device.label"
         excluded_probe_properties = "ibmvm.SysName"
      </correlation_names>

 

Attachments

uimapi-23.4.5.1.zip get_app
discovery_server-23.4.5.2.zip get_app