The user interface displays the Meterics-PostDeployment failed error message.

Problem

The system encountered an error while invoking post-deployment API calls after deploying the NSX Metrics feature.

Cause

After deploying the NSX Metrics feature, the system sends a post-deployment API request that invokes an API call to the NSX and ClusterApi pod on the NSX Application Platform. The system encountered an error

Solution

  1. Ensure that the system deployed the NSX Application Platform successfully.
  2. If you have access to the NSX Manager command line interface (CLI), use the following steps to investigate any errors recorded in the NSX Metrics logs. If you do not have access to the NSX Manager CLI, use the information provided in step 3.
    1. Log into the NSX Manager appliance as a root user.
    2. Mark the Kubernetes configuration for any subsequent helm and kubectl command invocation.
      export KUBECONFIG=/config/vmware/napps/.kube/config
    3. Use the following command to verify that the system has deployed the Metrics helm chart successfully.
      helm --namespace nsxi-platform list --all --filter 'metrics'

      The STATUS property must display deployed.

    4. Use the following command to verify that the setup pods were deployed and completed successfully.
      kubectl --namespace nsxi-platform get pods --selector='app.kubernetes.io/instance=metrics'
    5. Using the following command, inspect the logs of the metrics-app-server pod. The POD_NAME starts with metrics-app-server-* for any exceptions or errors.
      kubectl --namespace nsxi-platform logs <POD_NAME>
  3. If you do not have access to the NSX Manager CLI, collect the NSX Application Platform support bundle using information in Collect the Support Bundles for the NSX Application Platform Using the UI. Inspect the support bundle logs for the TKC or upstream Kubernetes pods whose names start with metrics-app-server.
  4. Post-deployment calls napp/api/v1/metrics/data-collection API GET and POST allow you to read and set the source for the data collection. You can toggle the data collection on or off. If there was problem encountered and the post deployment API did finish successfully, you can manually see if the data collection attribute for some of the hosts are not turned on, and then turn them on as desired.
  5. Additionally, the /infra/sites/intelligence/registration GET and /infra/sites/intelligence/registration/{cluster-id} POST APIs are called as part of the post-deployment step. The output of api/v1/infra/sites/intelligence/registration has an attribute is_metrics_enabled, which should be set during deployment and is an indication that post-deployment completed successfully. If it is not set, then you can manually set the NSX Metrics feature on using the following information.
    1. Invoke the GET napp/api/v1/metrics/data-collection command, which returns a JSON content, similar to the following.
      {
          "metrics_toggle_nsx": true,
          "metrics_toggle_nsx_cloud_native": true,
          "metrics_toggle_nsx_config": false
      }
    2. Locate all of the flags that are set to false and toggle them to true. More specifically, ensure that the metrics_toggle_nsx_config and metrics_toggle_nsx attributes are set to true.
      {
          "metrics_toggle_nsx": true,
          "metrics_toggle_nsx_cloud_native": true,
          "metrics_toggle_nsx_config": true
    3. Invoke the POST napp/api/v1/metrics/data-collection command using the modified body with flags set to true.