Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1989536

Summary: Pods created by latency tests should request available resources at the moment and/or allows the user to specify the amount
Product: OpenShift Container Platform Reporter: Talor Itzhak <titzhak>
Component: CNF Platform ValidationAssignee: Talor Itzhak <titzhak>
Status: CLOSED ERRATA QA Contact: Shereen Haj Makhoul <shajmakh>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.8CC: alukiano, aos-bugs, grajaiya, mcornea, shajmakh
Target Milestone: ---   
Target Release: 4.7.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The latency test pod was configured to always ask for the total amount of isolated CPUs minus one. Consequence: This behavior is not suited for all users. Fix: Allow specifying the number of isolated CPUs via the LATENCY_TEST_CPUS environment variable. Result: The users will be able to control the number of isolated CPUs and thus have better control over the latency test pod behavior.
Story Points: ---
Clone Of: 1989531 Environment:
Last Closed: 2022-02-21 10:19:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1989531    
Bug Blocks:    

Description Talor Itzhak 2021-08-03 12:14:15 UTC
+++ This bug was initially created as a clone of Bug #1989531 +++

+++ This bug was initially created as a clone of Bug #1986410 +++

Description of problem:

Pods created by latency tests should request available resources at the runtime and/or allows the user to specify the amount.

Version-Release number of selected component (if applicable):
4.8

How reproducible:
100%

Steps to Reproduce:
1. Run hwlatdetect tests on top of an SNO deployment with an existing performance profile


podman run --name cnf-container-tests  \
  --net=host  \
  -v /home/kni/cnf_tests_dir:/kubeconfig:Z  \
  -v /home/kni/cnf_tests_dir/junit:/junit:Z \
  -v /home/kni/cnf_tests_dir/report:/report:Z \
  -e KUBECONFIG=/kubeconfig/kubeconfig \
  -e IMAGE_REGISTRY=registry.kni-qe-0.lab.eng.rdu2.redhat.com:5000/ \
  -e CNF_TESTS_IMAGE=cnf-tests \
  -e LATENCY_TEST_RUN=true \
  -e LATENCY_TEST_RUNTIME=600 \
  -e OSLAT_MAXIMUM_LATENCY=20 \
  -e CYCLICTEST_MAXIMUM_LATENCY=20 \
  -e HWLATDETECT_MAXIMUM_LATENCY=20 \
  -e ROLE_WORKER_CNF=master \
  -e PERF_TEST_PROFILE=perfprofile-policy \
  -e DISCOVERY_MODE=true \
  quay.io/openshift-kni/cnf-tests \
  /usr/bin/test-run.sh  \
  -ginkgo.focus="\[performance\]\[config\]|\[performance\]\ Latency\ Test\ with\ the\ hwlatdetect" \
  --junit /junit -ginkgo.v


Applied performance profile spec:

  spec:
    cpu:
      isolated: 2-23,26-47
      reserved: 0-1,24-25
    globallyDisableIrqLoadBalancing: true
    hugepages:
      defaultHugepagesSize: 1G
      pages:
      - count: 16
        node: 0
        size: 1G
    machineConfigPoolSelector:
      pools.operator.machineconfiguration.openshift.io/master: ""
    nodeSelector:
      node-role.kubernetes.io/master: ""
    numa:
      topologyPolicy: restricted
    realTimeKernel:
      enabled: true

node resources:

    allocatable:
      cpu: "44"
      ephemeral-storage: "460405587616"
      hugepages-1Gi: 16Gi
      hugepages-2Mi: "0"
      memory: 80721928Ki
      pods: "250"
    capacity:
      cpu: "48"
      ephemeral-storage: 499572036Ki
      hugepages-1Gi: 16Gi
      hugepages-2Mi: "0"
      memory: 98625544Ki
      pods: "250"

hwlatdetect pod:

Name:         hwlatdetect-76t58
Namespace:    performance-addon-operators-testing
Priority:     0
Node:         <none>
Labels:       <none>
Annotations:  cpu-load-balancing.crio.io: true
              openshift.io/scc: node-exporter
Status:       Pending
IP:           
IPs:          <none>
Containers:
  hwlatdetect-runner:
    Image:      registry.kni-qe-0.lab.eng.rdu2.redhat.com:5000/cnf-tests
    Port:       <none>
    Host Port:  <none>
    Command:
      usr/bin/hwlatdetect-runner
    Args:
      -logtostderr=false
      -alsologtostderr=true
      -log_file=/host/hwlatdetect.log
      -hardlimit=20
      -threshold=20
    Limits:
      cpu:     43
      memory:  1Gi
    Requests:
      cpu:        43
      memory:     1Gi
    Environment:  <none>
    Mounts:
      /host from logs (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-rz6hm (ro)
Conditions:
  Type           Status
  PodScheduled   False 
Volumes:
  logs:
    Type:          HostPath (bare host directory volume)
    Path:          /var/log
    HostPathType:  Directory
  kube-api-access-rz6hm:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
    ConfigMapName:           openshift-service-ca.crt
    ConfigMapOptional:       <nil>
QoS Class:                   Guaranteed
Node-Selectors:              kubernetes.io/hostname=sno.kni-qe-1.lab.eng.rdu2.redhat.com
                             node-role.kubernetes.io/master=
Tolerations:                 node.kubernetes.io/memory-pressure:NoSchedule op=Exists
                             node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  54s (x2 over 55s)  default-scheduler  0/1 nodes are available: 1 Insufficient cpu.



node actual resource usage:

oc adm top node
W0727 09:29:16.492930  642972 top_node.go:119] Using json format to get metrics. Next release will switch to protocol-buffers, switch early by passing --use-protocol-buffers flag
NAME                                   CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
sno.kni-qe-1.lab.eng.rdu2.redhat.com   3557m        8%     29183Mi         37%   

Actual results:

hwlatdetect pod stays stuck in Pending because the requested resources are not available on the node

Expected results:
The requested resources by latency test pods should be set according to actual usage and/or allow user to override them.

Additional info:

Comment 4 Shereen Haj Makhoul 2022-02-16 13:33:21 UTC
verification:
 
Version:
cnf-tests: cnf-tests-container-v4.7.9-5
pao: registry.redhat.io/openshift4/performance-addon-rhel8-operator@sha256:3985bf8855808bfc6bd48527b9b9337530aaed84dc6aa439c689f498f1f64733

Steps:
podman run -v $(pwd)/:/kubeconfig:Z -e KUBECONFIG=/kubeconfig/kubeconfig -e IMAGE_REGISTRY=registry-proxy.engineering.redhat.com/rh-osbs/ -e CNF_TESTS_IMAGE=openshift4-cnf-tests:v4.7.9-5 -e LATENCY_TEST_RUN=true -e DISCOVERY_MODE=true -e ROLE_WORKER_CNF=worker-cnf -e LATENCY_TEST_CPUS=7 -e LATENCY_TEST_RUNTIME=100 -e MAXIMUM_LATENCY=20 registry-proxy.engineering.redhat.com/rh-osbs/openshift4-cnf-tests:v4.7.9-5  /usr/bin/test-run.sh -ginkgo.v -ginkgo.focus="oslat"

output of pod description:

..
    Limits:
      cpu:     7
      memory:  1Gi
    Requests:
      cpu:        7
      memory:     1Gi

& when not specifying the cpus, it will consume all isolated spus:

   Limits:
      cpu:     2
      memory:  1Gi
    Requests:
      cpu:        2
      memory:     1Gi

when this PP is applied:

apiVersion: performance.openshift.io/v2
kind: PerformanceProfile
metadata:
  name: performance
spec:
  cpu:
    isolated: "3-5"
    reserved: "0-2"
  realTimeKernel:
    enabled: true
  nodeSelector:
    node-role.kubernetes.io/worker-cnf: ""


Verified successfully.

Comment 6 errata-xmlrpc 2022-02-21 10:19:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.7.43 low-latency extras update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:0552