Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cgroups.plugin): do not add network devices if cgroup proc is in the host net ns #12788

Merged
merged 8 commits into from May 2, 2022

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Apr 30, 2022

Summary

detect_veth_interfaces() works correctly only when the cgroup proc (cgroup.procs) is not in the host network namespace.

The bug was discovered when we installed Netdata on a Proxmox host with several VMs.

$ readlink /proc/self/ns/net
net:[4026532008]
$ nsenter -t $(cat /sys/fs/cgroup/qemu.slice/103.scope/cgroup.procs) -n readlink /proc/self/ns/net
net:[4026532008]
$ ps -o comm= --pid $(cat /sys/fs/cgroup/qemu.slice/103.scope/cgroup.procs)
kvm

The end result is adding all double-linked host interfaces to the last discovered VM cgroup.

Screenshot Screenshot 2022-04-30 at 13 49 57
Screenshot when the patch applied Screenshot 2022-04-30 at 13 55 01
Test Plan

Check VM cgroups network interfaces.

Additional Information
For users: How does this change affect me?

surajnpn
surajnpn previously approved these changes May 2, 2022
thiagoftsm
thiagoftsm previously approved these changes May 2, 2022
@ilyam8 ilyam8 dismissed stale reviews from thiagoftsm and surajnpn via 7a687f4 May 2, 2022 08:20
@ilyam8 ilyam8 merged commit db9b85a into netdata:master May 2, 2022
@ilyam8 ilyam8 deleted the fix_cgroup_network_proxmox_vm branch May 2, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection collectors/cgroups
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants