Configuring VCF Usage Meter with NSX-T results in "Collection error: NullPointerException"
search cancel

Configuring VCF Usage Meter with NSX-T results in "Collection error: NullPointerException"

book

Article ID: 400987

calendar_today

Updated On:

Products

VMware NSX VMware Usage Meter

Issue/Introduction

When setting up new VCF Usage Meter 9.0 for 4.2.1 NSX instance, the following error is observed after credentials were verified successfully: error:Collection error: NullPointerException
 

Environment

VCF Usage Meter 9.0 and NSX 4.x

Cause

VCF Usage Meter returns java.lang.NullPointerException: Cannot invoke "String.equalsIgnoreCase(String)" because the return value of "com.vmware.um.nsxtcollector.api.ResourceReference.getTargetType()" is null

Resolution

Workaround will need to be performed using NSX APIs using tools like postman or curl.
 
For each VC cluster follow: # Call REST API to get all clusters - GET https://\lmhost/policy/api/v1/infra/settings/firewall/security/intrusion-services/cluster-configs/

  1. Call REST API per cluster Id to get cluster config - GET https://\lmhost/policy/api/v1/infra/settings/firewall/security/intrusion-services/cluster-configs/<cluster_id>
  2. Copy the payload from above response. Add "target_type": "VC_Cluster" in the "cluster". Use in the next step. For example:
    "cluster": {
            "target_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:domain-xxx",
            "target_type": "VC_Cluster" >>>> ADD THIS LINE
             }
  3. Call REST API to update target_type using above payload - PATCH https://\lmhost/policy/api/v1/infra/settings/firewall/security/intrusion-services/cluster-configs/<cluster_id>

Additional Information

Issue resolved in VCF Usage Meter 9.0.1 and 9.1
If the IDS/IPS is not enabled in the UI due to license issue.
 
Perform below workaround to disable IDS using API in NSX-T:
  • GET cluster config to verify if the ids_enabled is set to true, if its true run PATCH to set it to false.
    GET https://{{lmhost}}/policy/api/v1/infra/settings/firewall/security/intrusion-services/cluster-configs/<cluster-id>
  • Copy the response body and update ids_enabled=false
  • Use above updated content into PATCH call. Example:
    PATCH https://{{lmhost}}/policy/api/v1/infra/settings/firewall/security/intrusion-services/cluster-configs/<cluster-id>