Skip to content

fix(hostagent): ensure VFs are unmanaged by NetworkManager via persistent udev rule#52

Open
tsorya wants to merge 1 commit into
NVIDIA:public-release-v26.4from
tsorya:igal/nm-unmanaged-vfs-pr
Open

fix(hostagent): ensure VFs are unmanaged by NetworkManager via persistent udev rule#52
tsorya wants to merge 1 commit into
NVIDIA:public-release-v26.4from
tsorya:igal/nm-unmanaged-vfs-pr

Conversation

@tsorya
Copy link
Copy Markdown

@tsorya tsorya commented May 22, 2026

Summary

  • Add EnsureVFsUnmanaged() to the Backend interface so NM-specific udev rule logic is encapsulated in NetworkManagerBackend while systemd-networkd cleanly no-ops
  • Move udev rule logic from hostagent/util/udev.go into netconfig/nm_udev.go
  • Mount /etc/udev/rules.d from the host into the hostagent container (HostPathDirectoryOrCreate) to persist the NM unmanaged rule across reboots
  • Skip udevadm reload/trigger when the rule file is already up-to-date (idempotency for the 30s reconcile loop)

Background

NetworkManager only evaluates NM_UNMANAGED when a device first appears. The rule must exist in persistent /etc/udev/rules.d/ before VFs are created so NM never manages them. Previously the file was written to the container's ephemeral filesystem, invisible to the host.

Test plan

  • Unit tests (nm_udev_test.go): rule written + udevadm triggered on first run, idempotent skip, overwrite on mismatch, mkdir parents, error paths
  • Deploy hostdriver + controller and verify /etc/udev/rules.d/10-nm-unmanaged.rules on host
  • Verify VFs show unmanaged in nmcli device status

…tent udev rule

Add EnsureVFsUnmanaged() to the Backend interface so that NM-specific
udev rule logic is encapsulated in NetworkManagerBackend while
systemd-networkd cleanly no-ops.

Key changes:
- Move udev rule logic from hostagent/util into netconfig/nm_udev.go
- Mount /etc/udev/rules.d from host into hostagent container to persist
  the rule across reboots (HostPathDirectoryOrCreate)
- Skip udevadm reload/trigger when rule file is already up-to-date

NetworkManager only evaluates NM_UNMANAGED when a device first appears,
so the rule must be present before VFs are created.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant