Red Hat OpenShift Virtualization

9.2.37 Available from 9.2.37.

Red Hat OpenShift Virtualization is one of the virtualization technologies supported by License Metric Tool.

Purpose

Red Hat OpenShift Virtualization, a feature included with Red Hat OpenShift, provides a platform for running and deploying virtual machine (VM) workloads.

Important: Only bare metal (physical) worker nodes are supported.

Collecting capacity data

Note: ServiceAccount created for the License Metric Tool server requires cluster-wide permissions to:
  • virtualmachineinstances
  • nodes
  1. Configure Red Hat Open Shift cluster.
    1. To create a ServiceAccount for License Metric Tool server, use the following YAML configuration. Apply it through the + button in the Open Shift Web Console or with the oc apply command.
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: <SERVICE_ACCOUNT_NAME> 
        namespace: <SERVICE_ACCOUNT_NAMESPACE>
      
    2. To create a token for the newly created ServiceAccount, use the following YAML configuration.
      apiVersion: v1
      kind: Secret
      metadata:
        name: ilmt-service-account-token
        namespace: <SERVICE_ACCOUNT_NAMESPACE>
        annotations:
          kubernetes.io/service-account.name: <SERVICE_ACCOUNT_NAME>
      type: kubernetes.io/service-account-token
      
    3. To assign the necessary permissions to the previously created ServiceAccount, use the following YAML configuration. Replace <SERVICE_ACCOUNT_NAME> with the name of your service account and <SERVICE_ACCOUNT_NAMESPACE> with the namespace in which the service account is created.
      kind: ClusterRole
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: ilmt-cluster-nodes-list
      rules:
        - verbs:
            - list
          apiGroups:
            - ''
          resources:
            - nodes
      ---
      kind: ClusterRoleBinding
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: ilmt-cluster-nodes-list
      subjects:
        - kind: ServiceAccount
          name: <SERVICE_ACCOUNT_NAME>
          namespace: <SERVICE_ACCOUNT_NAMESPACE> 
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: ilmt-cluster-nodes-list
      ---
      kind: ClusterRole
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: ilmt-cluster-virtualmachineinstance-list
      rules:
        - verbs:
            - list
          apiGroups:
            - kubevirt.io
          resources:
            - virtualmachineinstances
      ---
      kind: ClusterRoleBinding
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: ilmt-cluster-virtualmachineinstance-list
      subjects:
        - kind: ServiceAccount
          name: <SERVICE_ACCOUNT_NAME> 
          namespace: <SERVICE_ACCOUNT_NAMESPACE>
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: ilmt-cluster-virtualmachineinstance-list
      
    4. Because it is not possible to retrieve all the information required for subcapacity license calculation, such as processor type or the number of worker node sockets, it is necessary to perform one of the following actions:
      • Define a pair of custom node labels in each node that is a virtual machine's hypervisor:
        • ibm.ilmt.sockets_count - containing the number of sockets
        • ibm.ilmt.cpu-model.vendor_id - with possible values of AMD/Intel.
      • Install and configure a Node Feature Discovery (Red Hat provided, and not Community Edition) add-on to your cluster to automatically add the following node labels to all your nodes:
        • feature.node.kubernetes.io/cpu-model.vendor_id

          This label is added automatically without any additional configuration of this add-on, immediately after you install the 'NodeFeatureDiscovery' operand from the 'Node Feature Discovery' operator.

        • feature.node.kubernetes.io/ibm.ilmt.socket_count
          To add this label, you need to add a custom resource of the NodeFeatureRule type. To do so, use the following YAML configuration:
          apiVersion: nfd.openshift.io/v1alpha1
          kind: NodeFeatureRule
          metadata:
            name: ibm.ilmt.capacity-sockets
            namespace: openshift-nfd
          spec:
            rules:
              - name: "ibm.ilmt.capacity-sockets"
                labelsTemplate: |
                  {{ range .cpu.topology }}ibm.ilmt.{{ .Name }}={{ .Value }}
                  {{ end }}
                matchFeatures:
                  - feature: cpu.topology
                    matchExpressions:
                      socket_count: {op: Exists}
          

      If the processor type or the number of sockets on a worker node cannot be detected, a default value of 120 PVUs per core is used to calculate the PVU license consumption for applications installed on virtual machines running on that node.

    To obtain the Service Account Token, perform the following steps.
    1. Go to Workload > Secrets and find ilmt-service-account-token.
    2. In the Secret details, locate the token in the Data section and copy it from there.
    Note: Do not copy the token from the YAML tab, as this token is encoded in Base64 and it will not work.
    To obtain the Cluster API address, perform the following step.:
    • Go to Home > Overview.
    • In the Details widget, find Cluster API address. For example: https://api.test.ibm.com:6443.
  2. Configure the License Metric Tool server.

Supported versions

For information about supported versions, go to IBM® License Metric Tool 9.2 - Supported Operating Systems and click Supported Hypervisor.