sysinv needs to handle 'kube-ignore-isol-cpus=disabled' as though the label didn't exist

Bug #1993199 reported by Chris Friesen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Jim Gauld

Bug Description

Currently the sysinv code just checks whether the 'kube-ignore-isol-cpus' key exists without checking the value of the label. So sysinv treats 'kube-ignore-isol-cpus=enabled' and 'kube-ignore-isol-cpus=disabled' the same.

We should only provide the "ignore isolcpus" behaviour if the label value is "enabled". This will align with the existing puppet behaviour.

Jim Gauld (jgauld)
Changed in starlingx:
assignee: nobody → Jim Gauld (jgauld)
Revision history for this message
Jim Gauld (jgauld) wrote :

To align, just change the sysinv method to match the handling of SRIOVDP_LABEL = 'sriovdp=enabled' in constants.py and kubernetes.py .

Change the code to this:
KUBE_IGNORE_ISOL_CPU_LABEL = 'kube-ignore-isol-cpus=enabled'
. .
        # determine whether to reserve isolated CPUs
        reserve_isolcpus = True
        labels = self.dbapi.label_get_by_host(host.uuid)
        for l in labels:
            if (constants.KUBE_IGNORE_ISOL_CPU_LABEL ==
                    str(l.label_key) + '=' + str(l.label_value)):
                reserve_isolcpus = False
                break

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/config/+/861764

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/861764
Committed: https://opendev.org/starlingx/config/commit/20e41bfb9f68aeb331bba7e7b6f1e7619c360705
Submitter: "Zuul (22348)"
Branch: master

commit 20e41bfb9f68aeb331bba7e7b6f1e7619c360705
Author: Jim Gauld <email address hidden>
Date: Tue Oct 18 10:12:39 2022 -0400

    Correct handling of kube-ignore-isol-cpus=disabled label

    This aligns the label checking kube-ignore-isol-cpus=<value>
    with the existing puppet behaviour.
    - kube-ignore-isol-cpus=enabled will ignore the isolcpus feature
    - any other value will not ignore the isolcpus feature

    Test Plan:
    PASS: Verify kube-ignore-isol-cpus=enabled after unlock the file
          /etc/kubernetes/ignore_isolcpus exists
    PASS: Verify kube-ignore-isol-cpus=disabled after unlock the file
          file /etc/kubernetes/ignore_isolcpus is not present

    Closes-Bug: 1993199

    Signed-off-by: Jim Gauld <email address hidden>
    Change-Id: I2ccfa98fffbdf6b4f45ad27e04ae0f3a937b13ae

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
tags: added: stx.8.0 stx.config
Changed in starlingx:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.