Red Hat OpenShift

Red Hat OpenShift

Red Hat OpenShift

Kubernetes-based container platform that provides a trusted environment to run enterprise workloads. It extends the Kubernetes platform with built-in software to enhance app lifecycle development, operations, and security

 View Only

OpenShift Licensing on Power

By MAARTEN KREUGER posted yesterday

  

With IBM's Power servers the licensing is a little different for OpenShift. As the Power systems are always running the IBM PowerVM hypervisor, RedHat has decided to only allow core licenses, and not socket licenses. The challenge then becomes to calculate the correct number of cores that need to be licensed, which in licensing is expressed in core-pairs, not single cores. 

Simultaneous Multithreading is a feature in the Power processor which presents a single core as multiple logical cpus. Somewhat similar to Intel's Hyperthreading, but on a much larger, more efficient scale. In the RedHat Documentation it is explained that it does not matter for licensing puposes:

"A large virtual machine (VM) might have 16 vCPUs, which at a SMT level 8 will require a 2 core subscription based on dividing the # of vCPUs by the SMT level (16 vCPUs / 8 for SMT-8 = 2). As subscriptions come in 2-core units, you will need one 2-core subscription to cover these 2 cores or 16 vCPUs."

Only worker nodes need to be licensed, infrastructure and master nodes do not need a license. As a Power system can host multiple LPARs (~VMs) this means we need to look at the cores that are assigned to all worker LPARs. When assigning cores to an LPAR they can be either dedicated or shared. If dedicated CPU is used the number of cores assigned is fixed and the licensing is clear. If shared CPU is used it is more complicated. 

With Shared CPU LPARs, each LPAR has an entitled capacity and a number of virtual processors. The first sets a minimum that the LPAR has a right to use, where the second defines the number of virtual CPUs that are available to the LPAR. In theory an LPAR can consume up to the number of defined virtual processors if the Power system has the available capacity for it. This depends on other LPARs on the system which also have entitlement to CPU, and possibly a similar overcommitment of CPU.

This means that the number of cores that need a license is equal to the number of virtual CPUs that are assigned to the LPAR. 

To limit the licenses needed, the number of virtual CPUs can be reduced, or the LPAR can be set to capped, which limits the amount of CPU to the exact number that the entitlement is set to, which can be a fraction of a CPU. 

A few calculation examples; Three Power servers, each equipped with 16 cores, each running a master, infra, and worker node. We only count the worker node:

  • each worker has 3 dedicated CPUs; ; licenses needed: (3 nodes x 3 Processors) / 2 = 5 core pairs
  • each worker has entitlement of 4.0 CPU, 8 Virtual Processors, runs uncapped; licenses needed: (3 nodes x 8 Virtual Processors) / 2 = 12 core pairs
  • each worker has entitlement of 4.0 CPU, 5 Virtual Processors, runs uncapped; licenses needed: (3 nodes x 5 Virtual Processors) / 2 = 8 core pairs
  • each worker has entitlement of 3.2 CPU, 4 Virtual Processors, runs capped; licenses needed: (3 nodes x 3.2 entitlement) / 2 = 5 core pairs

If a Power server is used for multiple OpenShift clusters the calculations above can still be used, but when running shared processors in uncapped mode to benefit from efficiency increase the CPU over-commitment can bring, we may end up licensing the same physical CPU twice. To prevent this, the concept of a shared processor pool within a power server exists. From the RedHat Manual:

"IBM Power have a notion of shared processor pools. The processors in a shared processor pool can be shared across the nodes in the cluster. The aggregate compute capacity required for a Red Hat OpenShift Data Foundation should be a multiple of core-pairs."

The default pool 0 contains all Power cores that are not assigned to dedicated CPU LPARs. This number is the maximum for the cores that can be licensed per machine when shared CPU LPARs are used. However, additional pools can be created for licensing and non-interference between LPARs. A shared processor LPAR can be a member of a single pool only. This means that if we have multiple worker nodes on a single Power Server we can make them members of a single pool, which sets the maximum number of licenses needed to the number of cores assigned to that pool.

A few calculation examples; one Power server with three worker node LPARs from different OpenShift clusters running on it:

  • Default pool is 20 cores; each worker has 4.0 CPU entitlement, 8 Virtual Processors, uncapped: min(20, ( 3 nodes x 8 Processors )) / 2 = 10 core-pairs
  • Pool size is 18 cores; each worker has 4.0 CPU entitlement, 5 Virtual Processors, uncapped: min(18, ( 3 nodes x 5 Processors )) / 2 = 8 core-pairs
  • Pool size is 12 cores; each worker has 4.0 CPU entitlement, 5 Virtual Processors, uncapped: min(12, ( 3 nodes x 5 Processors )) / 2 = 6 core-pairs

Shared processor pools can be very effective in setting the right amount of CPU for the worker nodes. 

In a Power system the Hardware Management Console (HMC) is used to view set the LPAR definitions. On the command line this can also be done, which makes auditing and control easier. The following bash script was written by Ronald van de Kuil to make collecting the information easier.

#!/bin/bash
cd /tmp
# Function to collect CPU info from a single node
collect_node_info() {
    local NODE=$1
    echo "=============================="
    echo "Node: $NODE"
    echo "=============================="
    ssh core@"$NODE" "hostname"
    ssh core@"$NODE" "grep -e serial_number -e pool= -e pool_capacity -e partition_entitled_capacity -e DesProcs -e capped /proc/ppc64/lparcfg"
    ssh core@"$NODE" "ppc64_cpu --smt"
}
# Get list of worker node FQDNs (strip the 'node/' prefix)
NODES=$(oc get nodes --selector node-role.kubernetes.io/worker -o name | sed 's#node/##')
for NODE in $NODES; do
    OUTFILE="${NODE}-cores.txt"
    # recreate file
    rm -f "$OUTFILE"
    # collect info and write to file
    collect_node_info "$NODE" | tee "$OUTFILE"
    echo
done
ls -lrt /tmp
tar -cvf worker-cores.tar os9*

I hope this explanation makes the OpenShift licensing clearer, but always discuss your licensing situation with your RedHat Sales representative.

0 comments
6 views

Permalink