From 9f5d9be84f72f0b03fd3f99179c69c8dd0178da3 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 28 Oct 2026 13:24:43 -0300 Subject: [PATCH] fix(sles): the installer of an IPv6-only node configures IPv4 and reaches nothing sles.pm gave linuxrc no network arguments beyond the net device. linuxrc configures IPv4 by default, so an IPv6-only node sent an IPv4 DHCPDISCOVER, received "no/incomplete answer", and reported "Failed to download AutoYaST file" without ever contacting the install source. static_ipv6_boot_args() adds ipv6only=1 with the address, prefix, gateway and IPv6 nameserver of the node. The node is configured statically for the reason anaconda.pm configures EL statically: the firmware answers DHCPv6 with the RFC 6355 DUID-UUID that the reservation is keyed on, while the installer builds a DUID of its own that matches no reservation. Measured on a Leap 15.6 node: with these arguments the installer fetched control.xml from http://[2001:db8:156::1]:80/install/leap15.6/x86_64/1 from its own address 2001:db8:156::10. Without ipv6only=1 linuxrc ignores the rest and stays on IPv4. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-server/lib/xcat/plugins/sles.pm | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index e8011211c3..f9bc4d35fc 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -46,6 +46,48 @@ sub rootimg_url #------------------------------------------------------- +=head3 static_ipv6_boot_args + + Descriptions: The linuxrc arguments that configure the installer network of an + IPv6-only node. + Arguments: the node + Returns: the arguments, or an empty list when the node has no IPv6 configuration + + linuxrc configures IPv4 by default, so an IPv6-only node reached no install + source. It is configured statically rather than with DHCPv6, for the reason + anaconda.pm configures EL statically: the firmware answers DHCPv6 with the + DUID-UUID of RFC 6355, which the reservation is keyed on, while the installer + builds a DUID of its own that matches no reservation. +=cut + +#------------------------------------------------------- +sub static_ipv6_boot_args +{ + my ($node) = @_; + + my ( $ip, $hostname, $gateway, $prefix ) = + xCAT::NetworkUtils->getNodeNetworkCfg6($node); + return () unless $ip && defined($prefix) && $prefix =~ /^\d+$/ && $prefix <= 128; + + my @args = ( 'ipv6only=1', "hostip=$ip/$prefix" ); + + if ( defined($gateway) && length($gateway) ) { + my $resolved = xCAT::NetworkUtils->ipv6_server_for_node( $node, $gateway ); + push @args, "gateway=$resolved" if $resolved; + } + + my $nameservers = xCAT::NetworkUtils->getNodeNameservers( [$node] ); + my $servers = $nameservers ? $nameservers->{$node} : undef; + if ($servers) { + my ($first) = grep { /:/ } split( /,/, $servers ); + push @args, "nameserver=$first" if $first; + } + + return @args; +} + +#------------------------------------------------------- + =head3 autoyast_boot_args Descriptions: The autoyast= and install= arguments of a diskful SLES or Leap install. @@ -1223,6 +1265,11 @@ sub mkinstall $kcmdline .= " $net_params->{netdevice} "; } + if ( xCAT::NetworkUtils->node_is_ipv6_only($node) ) { + my @ipv6_args = static_ipv6_boot_args($node); + $kcmdline .= ' ' . join( ' ', @ipv6_args ) . ' ' if @ipv6_args; + } + # Add the kernel paramets for driver update disk loading foreach (@dd_drivers) {