Bug 1949039 - Wrong env name to get podnetinfo for hugepage in app-netutil
Summary: Wrong env name to get podnetinfo for hugepage in app-netutil
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.8.0
Assignee: zhaozhanqi
QA Contact: zhaozhanqi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-13 10:03 UTC by zhaozhanqi
Modified: 2021-07-27 23:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-27 22:59:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 23:00:13 UTC

Description zhaozhanqi 2021-04-13 10:03:45 UTC
Description of problem:
When using app-netutil to get podnetinfo for hugepage

# oc exec -n z1 sriov-pod-1 -- ls /etc/podnetinfo
annotations
hugepages_1G_limit_sriov-example
hugepages_1G_request_sriov-example

However the logs show it's using wrong `/etc/podnetinfo/hugepages_request`
see below logs:

I0413 08:10:02.412266       1 app_sample.go:20] CALL netlib.GetCPUInfo:
I0413 08:10:02.412485       1 resource.go:27] getting cpuset from path: /proc/1/root/sys/fs/cgroup/cpuset/cpuset.cpus
I0413 08:10:02.412571       1 app_sample.go:26] netlib.GetCPUInfo Response:
| CPU     |: 0-79
I0413 08:10:02.412583       1 app_sample.go:30] CALL netlib.GetHugepages:
I0413 08:10:02.412589       1 hugepages.go:22] GetHugepages: Open /etc/podnetinfo/hugepages_request
I0413 08:10:02.412603       1 hugepages.go:25] Error getting /etc/podnetinfo/hugepages_request info: open /etc/podnetinfo/hugepages_request: no such file or directory
I0413 08:10:02.412614       1 hugepages.go:35] GetHugepages: Open /etc/podnetinfo/hugepages_limit
I0413 08:10:02.412623       1 hugepages.go:38] Error getting /etc/podnetinfo/hugepages_limit info: open /etc/podnetinfo/hugepages_limit: no such file or directory
I0413 08:10:02.412632       1 app_sample.go:33] Error calling netlib.GetHugepages: open /etc/podnetinfo/hugepages_request: no such file or directory


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


How reproducible:


Steps to Reproduce:
1. build one test pod using app-netutil repo
2. setup sriov operator
3. init VF by create policy
4. Create sriovnetwork to create net-attach-def resource
5. Create test pod with image step 1 build

apiVersion: v1
kind: Pod
metadata:
  name: sriov-pod-1
  annotations:
    k8s.v1.cni.cncf.io/networks: mlx277-netdevice
spec:
  containers:
  - name: sriov-example
    image: quay.io/zzhao/app-netutil
    imagePullPolicy: Never
    securityContext:
      privileged: true
    volumeMounts:
    #- mountPath: /etc/podnetinfo
    #  name: podnetinfo
    #  readOnly: false
    - mountPath: /dev/hugepages
      name: hugepage
    resources:
      requests:
        memory: 1Gi
        hugepages-1Gi: 2Gi
        #hugepages-2Mi: 2048Mi
        #cpu: "4"
      limits:
        memory: 1Gi
        hugepages-1Gi: 2Gi

  volumes:
  - name: hugepage
    emptyDir:
      medium: HugePages


6. Check pod logs

7. # oc exec -n z1 sriov-pod-1 -- ls /etc/podnetinfo
annotations
hugepages_1G_limit_sriov-example
hugepages_1G_request_sriov-example
labels



Actual results:

show error: 

I0413 08:10:02.412266       1 app_sample.go:20] CALL netlib.GetCPUInfo:
I0413 08:10:02.412485       1 resource.go:27] getting cpuset from path: /proc/1/root/sys/fs/cgroup/cpuset/cpuset.cpus
I0413 08:10:02.412571       1 app_sample.go:26] netlib.GetCPUInfo Response:
| CPU     |: 0-79
I0413 08:10:02.412583       1 app_sample.go:30] CALL netlib.GetHugepages:
I0413 08:10:02.412589       1 hugepages.go:22] GetHugepages: Open /etc/podnetinfo/hugepages_request
I0413 08:10:02.412603       1 hugepages.go:25] Error getting /etc/podnetinfo/hugepages_request info: open /etc/podnetinfo/hugepages_request: no such file or directory
I0413 08:10:02.412614       1 hugepages.go:35] GetHugepages: Open /etc/podnetinfo/hugepages_limit
I0413 08:10:02.412623       1 hugepages.go:38] Error getting /etc/podnetinfo/hugepages_limit info: open /etc/podnetinfo/hugepages_limit: no such file or directory
I0413 08:10:02.412632       1 app_sample.go:33] Error calling netlib.GetHugepages: open /etc/podnetinfo/hugepages_request: no such file or directory




Expected results:

should use '/etc/podnetinfo/hugepages_1G_limit_sriov-example' to get info other than '/etc/podnetinfo/hugepages_limit'

Additional info:

Comment 1 Billy McFall 2021-04-13 12:57:59 UTC
@zzhao Based on line numbers in the logs, looks like you are using an older version of the app-netutil code. Can you retest with latest master or release-4.8 branch (they are the same at the moment)?

Comment 3 zhaozhanqi 2021-06-01 07:45:15 UTC
Move this bug to Verified.

Comment 6 errata-xmlrpc 2021-07-27 22:59:58 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 (Moderate: OpenShift Container Platform 4.8.2 bug fix and security 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/RHSA-2021:2438


Note You need to log in before you can comment on or make changes to this bug.