From 0e9e723a237bae2156c523736833ccba8abb334b Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sun, 8 Nov 2026 11:19:28 -0300 Subject: [PATCH] fix(xcat-core): a node found by sequential discovery gets no DHCPv6 reservation findme assigned a node and recorded its MAC, its address, its BMC, its position, its groups and its chain, and never recorded the UUID the request carries. dhcp6_client_duids builds the DHCPv6 identity of a node from vpd.uuid, so makedhcp fell back to a DUID-LL derived from the MAC. None of the three boot stages sends a DUID-LL, so the reservation matched nothing and the node kept an address from the pool, which xcatd cannot map back to it. The node is discovered and then cannot be provisioned at the address it was given. findme now records the UUID through xCAT::DiscoveryUtils::vpd_attribs_from_findme, which takes the SMBIOS form only. The OpenEmbedded image synthesises "--" when the firmware reports no product_uuid, and a DUID built from that string would match no client either. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- perl-xCAT/xCAT/DiscoveryUtils.pm | 35 ++++++++++++++++++++ xCAT-server/lib/xcat/plugins/seqdiscovery.pm | 14 ++++++++ 2 files changed, 49 insertions(+) diff --git a/perl-xCAT/xCAT/DiscoveryUtils.pm b/perl-xCAT/xCAT/DiscoveryUtils.pm index 4da07036a0..d7aa7067dd 100644 --- a/perl-xCAT/xCAT/DiscoveryUtils.pm +++ b/perl-xCAT/xCAT/DiscoveryUtils.pm @@ -214,4 +214,39 @@ sub _first_value { return $name; } +#-------------------------------------------------------------------------------- + +=head3 vpd_attribs_from_findme + + The vpd attributes a findme request carries for the node it discovers. + + Arguments: + the findme request + Returns: + a hash reference of vpd attributes, empty when the request carries none + +=cut + +#-------------------------------------------------------------------------------- +sub vpd_attribs_from_findme +{ + my $request = shift; + if ( defined($request) && !ref($request) && $request eq __PACKAGE__ ) + { + $request = shift; + } + return {} unless ref($request) eq 'HASH'; + + my $uuid = $request->{uuid}; + $uuid = $uuid->[0] if ref($uuid) eq 'ARRAY'; + return {} unless defined($uuid); + + # The OpenEmbedded image synthesises "--" when the firmware + # reports no product_uuid. dhcp6_client_duids builds a DUID-UUID from this value, and a DUID + # built from that string matches no client, so only the SMBIOS form is recorded. + return {} unless $uuid =~ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/; + + return { uuid => lc($uuid) }; +} + 1; diff --git a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm index 625c4e8828..75e1a45393 100644 --- a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm +++ b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm @@ -282,6 +282,20 @@ sub findme { $sitetab->close(); } + # dhcp6_client_duids builds the DHCPv6 identity of a node from vpd.uuid, and there is + # no other table holding it. Without this the reservation falls back to a DUID-LL built + # from the MAC, which no boot stage of the node sends, and the node takes a pool address + # that xcatd cannot map back to it. + my $vpdattribs = xCAT::DiscoveryUtils->vpd_attribs_from_findme($request); + if ( keys %{$vpdattribs} ) { + my $vpdtab = xCAT::Table->new( 'vpd', -create => 1 ); + if ($vpdtab) { + $vpdtab->setNodeAttribs( $node, $vpdattribs ); + } else { + xCAT::MsgUtils->message( "S", "Discovery Error: Could not open table: vpd." ); + } + } + #set the groups for the node my $nltab = xCAT::Table->new('nodelist'); unless ($nltab) {