Category Requisition Policies Not Working

I have three policies in the req. defined to set categories with the following parameters

Policy 1 -
    category:  VM_Host
    matchBehavior:  ALL_PARAMETERS
    label: ~^.*[Vv][Ii][Ss].*
Policy 2 -
    matchBehavior:  ALL_PARAMETERS
    category: Site-DTM
Policy 3 -
    category:  VM_Guest
    label:  ~^.*[Vv][Ii][Ss].*
    matchBehavior:  NO_PARAMETERS

Policy 2 works as it should for all nodes in the requisition.

Policy 1 & 3 are intended to work from the hostnames in the ‘label’. VMWare hosts have the letters ‘vis’ in their hostname where guests do not. These are not working.

Any help would be appreciated.

Can you share the XML of the policies from ${OPENNMS_HOME/etc/foreign-sources/name.xml ?

  <policy name="Assign_Host_Category" class="org.opennms.netmgt.provision.persist.policies.NodeCategorySettingPolicy">
     <parameter key="matchBehavior" value="ALL_PARAMETERS"/>
     <parameter key="label" value="~^.*[Vv][Ii][Ss].*"/>
     <parameter key="category" value="VM_Host"/>
  <policy name="Assign_Site_Category" class="org.opennms.netmgt.provision.persist.policies.NodeCategorySettingPolicy">
     <parameter key="matchBehavior" value="ALL_PARAMETERS"/>
     <parameter key="category" value="Site-DTM"/>
  <policy name="Assign_Guest_Category" class="org.opennms.netmgt.provision.persist.policies.NodeCategorySettingPolicy">
     <parameter key="matchBehavior" value="NO_PARAMETERS"/>
     <parameter key="label" value="~^.*[Vv][Ii][Ss].*"/>
     <parameter key="category" value="VM_Guest"/>

Interesting. These are working as expected for me in a test environment. Have you synchronized the requisition with a full scan?

I had synced with full scan yesterday and it did not seem to affect anything.

I just checked the environment again today and now it appears that rule 3(VM_Guest) has started working. Rule 1 for VM_Host is still not.

How large is the requisition?

49 nodes. Only 4 happen to have the “VIS” in their hostnames.

Try switching your matchBehavior to ANY_PARAMETERS for Assign_Host_Category.

Change was made shortly after you suggested and I did a full sync. At this time, it does not seem to have had an effect.

Would this activity show up in one of the logs if bump up the logging level?

If you set provisiond to DEBUG, you could see the policies apply in provisiond.log. Rescan and search for NodeCategorySettingPolicy

Even at debug, there’s not a lot of detail there, unfortunately.

I deleted the that particular policy, sync’d, then recreated it. Seems to be working now.