Inventory from IBM License Service
IBM products (especially Cloud Paks) running in containers in a Kubernetes or OpenShift
cluster are required to have their license consumption tracked by the IBM License
Service, an application designed for this purpose. It monitors the Pod
s
in the cluster, consuming a set of standardized annotations that must be applied to
Pod
s running IBM products. It uses these annotations to determine
what products are in use, and what licensing terms the products use. It exposes this
information through a REST API.
k8s-ibm-licensing-1656883d-20210726T010000.ndi
- The Lightweight Kubernetes Inventory Agent requires that the
--ibm-licensing
flag is asserted (set to true) (see the example deployment.yaml file excerpt below) - The full Flexera Kubernetes Inventory Agent requires that the
spec.ibmLicensing.enable
attribute of theKRM
spec must be true:apiVersion: agents.flexera.com/v1 kind: KRM ... spec: ibmLicensing: enable: true
Connecting to the REST API for IBM License Service
- The Lightweight Kubernetes Inventory Agent uses command-line flags to provide it with the
correct URL for the API, and also with the token needed to authenticate with
the API (see Options for the Lightweight Kubernetes Agent, with particular attention to
--ibm-licensing
[which must be set to enable the integration],--ibm-licensing-url
, and--ibm-licensing-token
). Alternatively, the values may be set in the deployment.yaml file:apiVersion: apps/v1 kind: Deployment ... spec: template: spec: containers: - name: agent args: ... - --ibm-licensing - --ibm-licensing-url - https://ibm-licensing-service-instance.ibm-common-services.svc:8080 - --ibm-licensing-token - VoOMWJijBWuCxSxwgON11w7z
- The full Flexera Kubernetes Inventory Agent has the capacity to discover the API endpoint automatically, or it can be provided with the URL and token for the API in the same manner as the Lightweight Kubernetes Inventory Agent.
Data collection process
- Load the client configuration.
- Test the availability of the License Service API by issuing a request to its
/version
endpoint.- If the test fails, enter a retry loop with a 5 minute back-off until the test succeeds.
- Determine the current day (2022-06-30) in the UTC time zone.
- Determine the end of the period by subtracting one day from the current day (2022-06-29).
- Determine the start of the period by subtracting 179 days from the end of the period (2021-12-31).
- Request the product and bundled product data for each day from the start through the end of the period.
- Write and/or upload an inventory file containing all 180 days of data.
- Cache the final 7 days of the period.
- Wait until 01:00:00 the next day (2022-07-01).
- Request the product and bundled product data for the previous day (2022-06-30).
- Slide the cache forward one day, storing the new data and deleting the old data.
- Write and/or upload an inventory file containing the cached 7 days of data.
- Start a 24-hour timer.
- When the timer fires request the product and bundled product data for the previous day, slide the cache forward, produce an inventory.
- If so, it resumes the above process from step 9
- If not (for example, if the agent was disabled for several days), it starts from step 6 in the above process and requests data for the missing days.
The uploaded inventory format
ServiceProvider
block. This block includes:- The
/version
and/health
data (collected from the matching endpoints of the API) - The date range that the data covers
- A series of zero or more
Product
andBundledProduct
elements showing the related data recovered that day. These elements have addeddate
andclusterid
attributes, and otherwise mirror the IBM License Service data model (for details, see https://www.ibm.com/docs/en/cpfs?topic=service-license-swagger-api-schema).
ServiceProvider
block within the .ndi
file. The lines have been wrapped here for presentation, and the example uses dummy
data:<ServiceProvider Type="IBM License Service" LastInventoryResult="0"
LastInventoryError="" Name="d8259158-fdfe-4ba3-ae28-be62a51df7f9">
<Property Name="Version" Value="1.6.0"/>
<Property Name="BuildDate" Value="Mon Jul 12 16:45:52 UTC 2021"/>
<Property Name="IncompleteAnnotationCount" Value="0"/>
<Property Name="IncompleteAnnotationPods" Value=""/>
<Property Name="StartDate" Value="2021-07-24"/>
<Property Name="EndDate" Value="2021-07-25"/>
<Product date="2021-07-24T00:00:00Z" id="eb9998dcc5d24e3eb5b6fb488f750fe2"
name="IBM Cloud Pak for Data" metricName="VIRTUAL_PROCESSOR_CORE"
metricQuantity="2" clusterid="d8259158-fdfe-4ba3-ae28-be62a51df7f9"/>
<BundledProduct date="2021-07-24T00:00:00Z"
cloudpakId="eb9998dcc5d24e3eb5b6fb488f750fe2"
cloudpakName="IBM Cloud Pak for Data" cloudpakVersion="3.2.1"
productId="fb1b19783983ec76198729a9b945723"
productName="IBM Cloud Pak for Data Control Plane"
metricName="VIRTUAL_PROCESSOR_CORE"
cloudpakMetricName="VIRTUAL_PROCESSOR_CORE" metricConversion="1:1"
metricConvertedQuantity="2" metricMeasuredQuantity="2"
clusterid="d8259158-fdfe-4ba3-ae28-be62a51df7f9"/>
<Product date="2021-07-25T00:00:00Z" id="eb9998dcc5d24e3eb5b6fb488f750fe2"
name="IBM Cloud Pak for Data" metricName="VIRTUAL_PROCESSOR_CORE"
metricQuantity="2" clusterid="d8259158-fdfe-4ba3-ae28-be62a51df7f9"/>
<BundledProduct date="2021-07-25T00:00:00Z"
cloudpakId="eb9998dcc5d24e3eb5b6fb488f750fe2"
cloudpakName="IBM Cloud Pak for Data" cloudpakVersion="3.2.1"
productId="fb1b19783983ec76198729a9b945723"
productName="IBM Cloud Pak for Data Control Plane"
metricName="VIRTUAL_PROCESSOR_CORE"
cloudpakMetricName="VIRTUAL_PROCESSOR_CORE" metricConversion="1:1"
metricConvertedQuantity="2" metricMeasuredQuantity="2"
clusterid="d8259158-fdfe-4ba3-ae28-be62a51df7f9"/>
</ServiceProvider>
Field | Description |
---|---|
|
The date when the current version of the IBM License Service was compiled for release. |
|
The number of pods found with incomplete annotations about IBM Cloud Pak applications in use within the pod. |
|
The full version the IBM License Service |
|
A list of the pods where the required annotations are incomplete. |
|
If this attribute is empty, the API returned products and bundled
products for the last 30 days as a default. When either
|
|
See |
|
An element with the following attributes:
|
|
An element with the following attributes:
|
IT Asset Management (Cloud)
Current