From 9da20e00cd631c453c05ee04f2b85b8dc329b29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Fri, 30 Oct 2026 16:50:31 -0300 Subject: [PATCH] fix(netboot): keep EL10 diskless nodes from DHCP on every port NetworkManager in an EL10 diskless image made a DHCP profile for every Ethernet port without one. A port with a link but no DHCP server kept NetworkManager-wait-online from finishing, so the node booted degraded. Diskful nodes are not affected, because anaconda writes a profile for every port. genimage now sets no-auto-default=* in the NetworkManager configuration of EL10 images. The boot interface keeps the profile from the initial ramdisk. The other interfaces get only the profiles that the image or the xCAT network configuration gives them. --- xCAT-server/share/xcat/netboot/imgutils/imgutils.pm | 13 +++++++++++++ xCAT-server/share/xcat/netboot/rh/genimage | 1 + 2 files changed, 14 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm b/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm index 8ba604ba0c..8f0d0ec7e0 100644 --- a/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm +++ b/xCAT-server/share/xcat/netboot/imgutils/imgutils.pm @@ -223,6 +223,19 @@ sub write_nic_profiles { return; } +# NetworkManager otherwise makes a DHCP profile for every Ethernet port without one. +sub disable_auto_profiles { + my ($rootimg_dir, $osver) = @_; + my $major = el_major_version($osver); + my $confdir = "$rootimg_dir/etc/NetworkManager/conf.d"; + return unless defined($major) && $major >= 10 && -d $confdir; + my $file = "$confdir/xcat.conf"; + my $fh; + open($fh, '>', $file) && print($fh "[main]\nno-auto-default=*\n") && close($fh) + or die("Error: cannot write $file: $!\n"); + return; +} + sub varsubinline{ my $line=shift; my $refvardict=shift; diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index a73e254e98..26826cb2fb 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -2167,6 +2167,7 @@ sub generic_post { #This function is meant to leave the image in a state approxi close($cfgfile); imgutils::write_nic_profiles($rootimg_dir, $osver, $prinic, $othernics); + imgutils::disable_auto_profiles($rootimg_dir, $osver); # securetty not needed on s390x if ($arch ne "s390x") {