2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-05-02 21:17:48 +00:00

fix: Replace yaboot with grub2 for PPC nodediscovery

Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst Selli
2026-03-18 18:20:10 -03:00
parent d309601a30
commit 90a84dc375
7 changed files with 19 additions and 27 deletions

View File

@@ -1497,20 +1497,15 @@ sub get_netboot_attr {
# It's sequence sensitive: os arch -> os name -> os major version -> hardware profile
# Priority | Arch | OS Name | OS Major Version | Management method | Noderes.netboot |
# 1 | x86_64/x86 | * | * | * | xnba |
# 2 | ppc64 | rhels | 7 | * | grub2 |
# 2 | ppc64 | pkvm | * | * | petitboot |
# 3 | | * | * | * | yaboot |
# 3 | ppc64 | * | * | * | grub2 |
# 4 | ppc64le/el | * | * | * | grub2
# 4 | ppc64le/el | * | * | ipmi | petitboot
# arch osname version hardware netboot
my %netboot_dict = ('x86_64' => 'xnba',
'ppc64' => {
'rhels' => {
'7' => 'grub2',
'*' => 'yaboot',
},
'pkvm' => 'petitboot',
'*' => 'yaboot',
'*' => 'grub2',
},
'ppc64le' => {
'*' => {

View File

@@ -2750,8 +2750,8 @@ sub addnet
" } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n";
push @netent, " option www-server = \"http://$tftp:$httpport/install/onie/onie-installer\";\n";
push @netent,
" } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n ";
push @netent, " filename \"/yaboot\";\n";
" } else if substring(filename,0,1) = null { #otherwise, provide grub2 for PPC firmware that omits a client architecture\n ";
push @netent, " filename \"/boot/grub2/grub2.ppc\";\n";
push @netent, " }\n";
if ($range) {

View File

@@ -234,8 +234,8 @@ sub process_request {
$nrtab->setNodeAttribs($node, { netboot => 'xnba' });
} elsif ($request->{arch}->[0] =~ /ppc/ and $request->{platform}->[0] =~ /PowerNV/) {
$nrtab->setNodeAttribs($node, { netboot => 'petitboot' });
} elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /yaboot/) {
$nrtab->setNodeAttribs($node, { netboot => 'yaboot' });
} elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /^grub2(?:[-].*)?$/) {
$nrtab->setNodeAttribs($node, { netboot => 'grub2' });
} elsif($request->{arch}->[0] =~ /armv7l/ and $currboot !~ /onie/) {
#for onie switch, the netboot should be "onie"
$nrtab->setNodeAttribs($node, { netboot => 'onie' });

View File

@@ -1172,7 +1172,7 @@ sub writelpar {
# Set some attrs common to all lpars
$tables{'nodetype'}->setNodeAttribs('lpar', { nodetype => 'ppc,osi', arch => 'ppc64' });
$tables{'nodehm'}->setNodeAttribs('lpar', { mgt => 'fsp', cons => 'fsp' });
$tables{'noderes'}->setNodeAttribs('lpar', { netboot => 'yaboot' });
$tables{'noderes'}->setNodeAttribs('lpar', { netboot => 'grub2' });
# Write regexs for some of the ppc attrs
# Note: we assume here that if they used f1c1p1 for nodes they should use f1c1 for cecs
@@ -1468,7 +1468,7 @@ sub writesn {
$tables{'ppc'}->setNodeAttribs('service', { id => '1', nodetype => 'lpar' });
$tables{'nodetype'}->setNodeAttribs('service', { nodetype => 'ppc,osi', arch => 'ppc64' });
$tables{'nodehm'}->setNodeAttribs('service', { mgt => 'fsp', cons => 'fsp' });
$tables{'noderes'}->setNodeAttribs('service', { netboot => 'yaboot' });
$tables{'noderes'}->setNodeAttribs('service', { netboot => 'grub2' });
$tables{'servicenode'}->setNodeAttribs('service', { nameserver => 1, dhcpserver => 1, tftpserver => 1, nfsserver => 1, conserver => 1, monserver => 1, ftpserver => 1, nimserver => 1, ipforward => defined($STANZAS{'xcat-service-nodes'}->{'route-masks'}) });
if ($STANZAS{'ll-config'}->{'central_manager_list'}) { # write the LL postscript for service nodes
addPostscript('service', 'llserver.sh')
@@ -1621,7 +1621,7 @@ sub writestorage {
$tables{'ppc'}->setNodeAttribs('storage', { id => '1', nodetype => 'lpar' });
$tables{'nodetype'}->setNodeAttribs('storage', { nodetype => 'ppc,osi', arch => 'ppc64' });
$tables{'nodehm'}->setNodeAttribs('storage', { mgt => 'fsp', cons => 'fsp' });
$tables{'noderes'}->setNodeAttribs('storage', { netboot => 'yaboot' });
$tables{'noderes'}->setNodeAttribs('storage', { netboot => 'grub2' });
# Figure out what cec each storage node is in and write ppc.hcp, ppc.parent, noderes.xcatmaster, noderes.servicenode
# Math for SN in BB: cecnum = ( ( (snnum-1) / snsperbb) * cecsperbb) + cecstart-1 + snpositioninbb
@@ -1789,7 +1789,7 @@ sub writecompute {
$tables{'ppc'}->setNodeAttribs('compute', { nodetype => 'lpar' });
$tables{'nodetype'}->setNodeAttribs('compute', { nodetype => 'ppc,osi', arch => 'ppc64' });
$tables{'nodehm'}->setNodeAttribs('compute', { mgt => 'fsp', cons => 'fsp' });
$tables{'noderes'}->setNodeAttribs('compute', { netboot => 'yaboot' });
$tables{'noderes'}->setNodeAttribs('compute', { netboot => 'grub2' });
if ($STANZAS{'ll-config'}->{'central_manager_list'}) { # write the LL postscript for compute nodes
addPostscript('compute', 'llcompute.sh');
}

View File

@@ -81,7 +81,7 @@ my %URIdef = (
PUT => {
desc => "Change the attibutes for the node {nodename}.",
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||",
example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/nodes/node1 {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||",
cmd => "chdef",
fhandler => \&defhdl,
outhdler => \&noout,
@@ -89,7 +89,7 @@ my %URIdef = (
POST => {
desc => "Create the node {nodename}.",
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
example => "|Create a node with attributes groups=all, mgt=dfm and netboot=yaboot|POST|/nodes/node1 {\"groups\":\"all\",\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||",
example => "|Create a node with attributes groups=all, mgt=hmc and netboot=grub2|POST|/nodes/node1 {\"groups\":\"all\",\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||",
cmd => "mkdef",
fhandler => \&defhdl,
outhdler => \&noout,
@@ -571,7 +571,7 @@ my %URIdef = (
PUT => {
desc => "Change the attibutes for the group {groupname}.",
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||",
example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/groups/all {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||",
cmd => "chdef",
fhandler => \&defhdl,
outhdler => \&noout,
@@ -583,7 +583,7 @@ my %URIdef = (
GET => {
desc => "Get the specific attributes for the group {groupname}.",
usage => "||$usagemsg{objreturn}|",
example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"yaboot\",\n \"mgt\":\"dfm\"\n }\n}|",
example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"grub2\",\n \"mgt\":\"hmc\"\n }\n}|",
cmd => "lsdef",
fhandler => \&defhdl,
outhdler => \&defout,
@@ -2745,4 +2745,3 @@ sub pushFlags {
}
}

View File

@@ -158,7 +158,7 @@ RESTMSG="Display the node restapinode1"
REST GET "/nodes/restapinode1"
RESTMSG="Change the attributes for node restapinode1"
REST PUT "/nodes/restapinode1" '{"mgt":"fsp","netboot":"yaboot"}'
REST PUT "/nodes/restapinode1" '{"mgt":"hmc","netboot":"grub2"}'
RESTMSG="Display the node restapinode1"
REST GET "/nodes/restapinode1"
@@ -194,4 +194,3 @@ REST GET "/groups/restapi"
RESTMSG="Display the nodes in group restapi"
REST GET "/nodes/restapi"

View File

@@ -83,7 +83,7 @@ my %URIdef = (
PUT => {
desc => "Change the attributes for the node {noderange}.",
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||",
example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/nodes/node1 {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||",
cmd => "chdef",
fhandler => \&defhdl,
outhdler => \&noout,
@@ -91,7 +91,7 @@ my %URIdef = (
POST => {
desc => "Create the node {noderange}.",
usage => "|$usagemsg{objchparam} DataBody: {options:{opt1:v1,opt2:v2},attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
example => "|Create a node with attributes groups=all, mgt=dfm and netboot=yaboot|POST|/nodes/node1 {\"options\":{\"--template\":\"x86_64kvmguest-template\"}, \"groups\":\"all\",\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||",
example => "|Create a node with attributes groups=all, mgt=hmc and netboot=grub2|POST|/nodes/node1 {\"options\":{\"--template\":\"x86_64kvmguest-template\"}, \"groups\":\"all\",\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||",
cmd => "mkdef",
fhandler => \&defhdl,
outhdler => \&noout,
@@ -657,7 +657,7 @@ my %URIdef = (
PUT => {
desc => "Change the attributes for the group {groupname}.",
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||",
example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/groups/all {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||",
cmd => "chdef",
fhandler => \&defhdl,
outhdler => \&noout,
@@ -669,7 +669,7 @@ my %URIdef = (
GET => {
desc => "Get the specific attributes for the group {groupname}.",
usage => "||$usagemsg{objreturn}|",
example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"yaboot\",\n \"mgt\":\"dfm\"\n }\n}|",
example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"grub2\",\n \"mgt\":\"hmc\"\n }\n}|",
cmd => "lsdef",
fhandler => \&defhdl,
outhdler => \&defout,
@@ -3589,4 +3589,3 @@ sub pushFlags {
}
}