From bfbc48c698e0a0b145c02b10b496b42d4abe3bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Mon, 4 May 2026 18:52:13 -0300 Subject: [PATCH] fix: fail nodeset when MASTER_IP cannot be resolved Template.pm silently continued rendering kickstart templates when getipaddr() failed to resolve the master hostname, producing kickstarts with an empty MASTER_IP. Nodes would install successfully but fail on first reboot when post.xcat and xcatinstallpost tried to contact the master, timing out after 90 retries with: the network between the node and is not ready Postage.pm (mypostscript generation) already checks for this and returns a clear error. Apply the same pattern in Template.pm so nodeset fails immediately with a descriptive message instead of producing a broken kickstart. Fixes #7544 --- xCAT-server/lib/perl/xCAT/Template.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index d7ee2826c..d233e94bb 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -123,9 +123,11 @@ sub subvars { $ENV{XCATMASTER} = $master; my $ipaddr = xCAT::NetworkUtils->getipaddr($master); - if ($ipaddr) { - $ENV{MASTER_IP} = "$ipaddr"; + unless ($ipaddr) { + $tmplerr = "Unable to resolve master \"$master\" to an IP address for $node"; + return; } + $ENV{MASTER_IP} = "$ipaddr"; my @nodestatus = xCAT::TableUtils->get_site_attribute("nodestatus"); my $tmp = $nodestatus[0];