Troubleshooting License Service Reporter

Learn how to troubleshoot License Service Reporter.

Enabling additional information in logs for troubleshooting purposes

By default, the License Service Reporter instance pod logs contain only the basic information about the service.

You can enable additional information in logs for troubleshooting purposes by updating the IBMLicenseServiceReporter custom resource.

Complete the following steps to enable additional information in logs:

  1. Log in to your OpenShift console.
  2. Go to Operators > Installed Operators.
  3. From the Project drop-down list, select All Projects.
  4. Select IBM Licensing Operator.
  5. Select the IBMLicense Service Reporter tab. The instance of License Service Reporter custom resource is listed.
  6. From the overflow action menu, select IBMLicenseServiceReporter.
  7. Edit the YAML. To enable additional information in logs, add the following line: logLevel: DEBUG under spec.

The available logLevel options:

Following is an example configuration:

spec:
  logLevel: DEBUG

No data visible in License Service Reporter after configuring data sources

Note: Data sent by License Service (License Service Reporter datasource) will be visible in License Service Reporter after around an hour of configuring data sources.

In case if no data is visible from datasource License Service Reporter:

Sending historical data to License Service Reporter and resynchronizing datasources

The described procedure covers the following scenarios:

Prerequisites:

Important:

Steps

  1. Backup License Service Reporter token and licensing data:

    1. Define the namespace where License Service Reporter is deployed. By default, it is ibm-common-services namespace:

      LICENSING_NAMESPACE=ibm-common-services
      
    2. Backup token to the file on your computer.

      kubectl get secret ibm-licensing-reporter-token -n ${LICENSING_NAMESPACE} -o=jsonpath='{.data.token}' > token.txt
      
    3. Generate an audit snapshot from License Service Reporter for the backup purpose.

  2. Clean License Service Reporter database by deleting the License Service Reporter instance:

    1. Log in to your OpenShift cluster console.

    2. Go to Operators > Installed Operators.

    3. Set the project to All Projects.

    4. Find and select the IBM Licensing.

    5. In the navigation bar, go to IBM License Service Reporter tab and delete existing instance.

      The image shows deleting License Service reporter.

    6. Confirm that you want to delete the License Service Reporter.

    7. Wait until the License Service Reporter pod disappears.

  3. Deploy the newest License Service Reporter. Wait until License Service Reporter pod is up and running.

  4. Optional: Restore backed up token.

    Note: Skip this step if you deploy License Service Reporter for the first time.

    1. Apply saved value to the secret on the cluster, where the License Service reporter is deployed.

      cat token.txt | xargs -I {} kubectl patch secret ibm-licensing-reporter-token -n ${LICENSING_NAMESPACE} -p '{"data":{"token":"{}"}}'
      
    2. Restart License Service Reporter pod.

      lsrPodName=$(kubectl get pods -n ${LICENSING_NAMESPACE} | grep ibm-license-service-reporter-instance | awk '{print $1}')
      kubectl delete pod ${lsrPodName} -n ${LICENSING_NAMESPACE}
      
    3. Restart License Service pod on the same cluster where License Service Reporter is deployed.

      lsPodName=$(kubectl get pods -n ${LICENSING_NAMESPACE} | grep ibm-licensing-service-instance | awk '{print $1}')
      kubectl delete pod ${lsPodName} -n ${LICENSING_NAMESPACE}
      
  5. Optional: Configure each cluster that was configured to feed data to License Advisor as a data source for License Service Reporter. For more information, see Configuring data sources for License Service Reporter.

    Note:

    • Skip this step if you are resetting previously deployed License Service Reporter.

    • For the cluster where you deployed License Service Reporter, the License Service instance is automatically configured. Therefore, you do not need to perform any configuration for this cluster.

  6. Synchronize License Service historical data.

    Note: This step synchronizes the license usage data only. The user-defined threshold values are not synchronized, and the values need to be set manually afterwards.

    Important: Perform this step on each cluster with License Service that is configured as License Service Reporter datasource, including License Service instance on the cluster with License Service Reporter.

    1. Upgrade License Service instance to the latest version. Wait until the pod is running.

    2. Define the synchronization start date. The start data determines the time starts when the License Service data is sent to the License Service Reporter. Provide the date in the [year,month,day] format. By default, the date is set to License Service first release date.

      START_SYNC_DATE=[2020,4,6]
      
    3. Define the namespace where License Service is deployed. By default, License Service is deployed in ibm-common-services namespace:

      LICENSING_NAMESPACE=ibm-common-services
      
    4. Apply the synchronization start date by running the following command:

      For OSX:

      kubectl get cm ibm-licensing-config -n ${LICENSING_NAMESPACE} -o jsonpath="{.binaryData.data}" | base64 -d | gzip -d | jq -c ".lastHubSynchronizationDate = ${START_SYNC_DATE}" | gzip | base64 | xargs -I {} kubectl patch cm ibm-licensing-config -n ${LICENSING_NAMESPACE} -p '{"binaryData":{"data":"{}"}}'
      

      For Linux:

      kubectl get cm ibm-licensing-config -n ${LICENSING_NAMESPACE} -o jsonpath="{.binaryData.data}" | base64 -d | gzip -d | jq -c ".lastHubSynchronizationDate = ${START_SYNC_DATE}" | gzip | base64 -w 0 | xargs -I {} kubectl patch cm ibm-licensing-config -n ${LICENSING_NAMESPACE} -p '{"binaryData":{"data":"{}"}}'
      
  7. Wait until your data is migrated to License Service Reporter. It takes from 12 to 24 hours to migrate the data from all the clusters and show the data on the License Service Reporter UI.

  8. Access the Licensing dashboard, the License Service Reporter UI. For more information, see Viewing license usage on the Licensing dashboard.

  9. Recover the threshold values manually. For more information, see Setting the license usage threshold.