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:
@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)?
Move this bug to Verified.
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