From be85fd9a7f9cc18a5a8873a1bcc4bcbea6ecbada Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 24 Jun 2026 06:28:18 -0300 Subject: [PATCH] fix(xcat-server): fix Ubuntu autoinstall netplan for match-by-MAC nodes When a node's install NIC is selected by MAC (installnic=mac), the generated netplan was invalid: it named the ethernet device the literal string 'mac' and set its MAC match to the full pipe-delimited list of all node MACs. The result had no valid interface, so neither the installer environment nor the installed system came up on the network. Match the install NIC by interface-name glob in the installer, and in the target use only the primary MAC and omit set-name when the install NIC is selected by MAC. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> (cherry picked from commit c6e38483fbc7466c5666a89441cd259b46f5691f) --- .../share/xcat/install/ubuntu/compute.subiquity.tmpl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl index 14061a21c..31a978cbc 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl @@ -6,7 +6,9 @@ autoinstall: network: version: 2 ethernets: - '#TABLE:noderes:$NODE:installnic#': + xcat-install: + match: + name: "e*" dhcp4: true ssh: allow-pw: true @@ -74,9 +76,13 @@ autoinstall: cat /tmp/pre-install.log >> /target/var/log/xcat/xcat.log; installnic="#TABLE:noderes:$NODE:installnic#"; installmac="#TABLE:mac:$NODE:mac#"; - installmac="$(printf ''%s'' "${installmac}" | tr ''A-F'' ''a-f'')"; + installmac="$(printf ''%s'' "${installmac}" | cut -d''|'' -f1 | cut -d''!'' -f1 | tr ''A-F'' ''a-f'')"; mkdir -p /target/etc/netplan; - printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " set-name: ${installnic}" " dhcp4: true" >/target/etc/netplan/00-xcat-install.yaml; + if [ "${installnic}" = "mac" ]; then + printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " dhcp4: true" >/target/etc/netplan/00-xcat-install.yaml; + else + printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " set-name: ${installnic}" " dhcp4: true" >/target/etc/netplan/00-xcat-install.yaml; + fi; chmod 600 /target/etc/netplan/00-xcat-install.yaml; printf ''%s\n'' ''#HOSTNAME#'' >/target/etc/hostname; if grep -q ''^127\.0\.1\.1'' /target/etc/hosts; then