-Migrate kernel, initrd, kcmdline to new bootparams table from noderes
-Migrate serialport to nodehm from noderes git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1205 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
9dc382ec1a
commit
b5f9d956f4
@ -174,7 +174,7 @@ nodegroup => {
|
||||
},
|
||||
},
|
||||
nodehm => {
|
||||
cols => [qw(node power mgt cons termserver termport conserver serialspeed serialflow getmac comments disable)],
|
||||
cols => [qw(node power mgt cons termserver termport conserver serialport serialspeed serialflow getmac comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => "Settings that control how each node's hardware is managed. Typically, an additional table that is specific to the hardware type of the node contains additional info. E.g. the ipmi, mp, and ppc tables.",
|
||||
descriptions => {
|
||||
@ -185,9 +185,10 @@ nodehm => {
|
||||
termserver => 'The hostname of the terminal server.',
|
||||
termport => 'The port number on the terminal server that this node is connected to.',
|
||||
conserver => 'The hostname of the machine where the conserver daemon is running. If not set, the default is the xCAT management node.',
|
||||
serialspeed => 'The speed of the serial port for this node. For SOL on blades, this is typically 19200.',
|
||||
serialflow => "The flow value of the serial port for this node. For SOL on blades, this is typically 'hard'.",
|
||||
getmac => 'The method to use to get MAC address of the node. If not set, the mgt attribute will be used. Valid values: switch, blade, ivm, hmc??',
|
||||
serialport => 'The serial port for this node, in the linux numbering style (0=COM1/ttyS0, 1=COM2/ttyS1). For SOL on IBM blades, this is typically 1. For rackmount IBM servers, this is typically 0.',
|
||||
serialspeed => 'The speed of the serial port for this node. For SOL this is typically 19200.',
|
||||
serialflow => "The flow control value of the serial port for this node. For SOL this is typically 'hard'.",
|
||||
getmac => 'The method to use to get MAC address of the node with the getmac command. If not set, the mgt attribute will be used. Valid values: blade, ivm, hmc??',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@ -219,6 +220,17 @@ nodepos => {
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
bootparams => {
|
||||
cols => [qw(node kernel initrd kcmdline comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'Current boot settings to be sent to systems attempting network boot for deployment, stateless, or other reasons. Mostly automatically manipulated',
|
||||
descriptions => {
|
||||
'node' => 'The node or group name',
|
||||
'kernel' => 'The kernel that network boot actions should currently acquire and use. Note this could be a chained boot loader such as memdisk or a non-linux boot loader',
|
||||
'initrd' => 'The initial ramdisk image that network boot actions should use (could be a DOS floppy or hard drive image if using memdisk as kernel)',
|
||||
'kcmdline' => 'Arguments to be passed to the kernel'
|
||||
}
|
||||
},
|
||||
noderes => {
|
||||
cols => [qw(node servicenode netboot tftpserver nfsserver monserver kernel initrd kcmdline nfsdir serialport installnic primarynic xcatmaster current_osimage next_osimage comments disable)],
|
||||
keys => [qw(node)],
|
||||
@ -230,11 +242,12 @@ noderes => {
|
||||
tftpserver => 'The TFTP server for this node (as known by this node).',
|
||||
nfsserver => 'The NFS server for this node (as known by this node).',
|
||||
monserver => 'The monitoring aggregation point for this node (as known by the management node).',
|
||||
kernel => 'The linux kernel version to install on the node.',
|
||||
initrd => 'The linux initial ramdisk image used to deploy the node.',
|
||||
kcmdline => 'The kernel command line used to deploy the node.',
|
||||
kernel => 'DEPRECATED, only here for migration to bootparams table',
|
||||
initrd => 'DEPRECATED, only here for migration to bootparams table',
|
||||
kcmdline => 'DEPRECATED, only here for migration to bootparams table',
|
||||
nfsdir => 'Not used?? The path that should be mounted from the NFS server.',
|
||||
serialport => 'The serial port for this node. For SOL on blades, this is typically 1. For IPMI, this is typically 0.',
|
||||
serialport => 'DEPRECATED, migrate to nodehm table',
|
||||
#serialport => 'The serial port for this node. For SOL on blades, this is typically 1. For IPMI, this is typically 0.',
|
||||
installnic => 'The network adapter on the node that will be used for OS deployment. If not set, primarynic will be used.',
|
||||
primarynic => 'The network adapter on the node that will be used for xCAT management. Default is eth0.',
|
||||
xcatmaster => 'The hostname of the xCAT service node (as known by this node). This is the default value if nfsserver or tftpserver are not set.',
|
||||
@ -538,16 +551,16 @@ my @nodeattrs = (
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
},
|
||||
{attr_name => 'kernel',
|
||||
tabentry => 'noderes.kernel',
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
tabentry => 'bootparams.kernel',
|
||||
access_tabentry => 'bootparams.node=attr:node',
|
||||
},
|
||||
{attr_name => 'initrd',
|
||||
tabentry => 'noderes.initrd',
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
tabentry => 'bootparams.initrd',
|
||||
access_tabentry => 'bootparams.node=attr:node',
|
||||
},
|
||||
{attr_name => 'kcmdline',
|
||||
tabentry => 'noderes.kcmdline',
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
tabentry => 'bootparams.kcmdline',
|
||||
access_tabentry => 'bootparams.node=attr:node',
|
||||
},
|
||||
# Note that the serialport attr is actually defined down below
|
||||
# with the other serial* attrs from the nodehm table
|
||||
@ -662,11 +675,9 @@ my @nodeattrs = (
|
||||
tabentry => 'nodehm.getmac',
|
||||
access_tabentry => 'nodehm.node=attr:node',
|
||||
},
|
||||
# Note that serialport is in the noderes table. Keeping it here in
|
||||
# the defspec so that it gets listed with the other serial* attrs
|
||||
{attr_name => 'serialport',
|
||||
tabentry => 'noderes.serialport',
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
tabentry => 'nodehm.serialport',
|
||||
access_tabentry => 'nodehm.node=attr:node',
|
||||
},
|
||||
{attr_name => 'serialspeed',
|
||||
tabentry => 'nodehm.serialspeed',
|
||||
|
@ -104,7 +104,6 @@ Output is similar to:
|
||||
rra001a: noderes.xcatmaster: rra000
|
||||
rra001a: noderes.installnic: eth0
|
||||
rra001a: noderes.netboot: pxe
|
||||
rra001a: noderes.serialport: 1
|
||||
rra001a: noderes.servicenode: rra000
|
||||
rra001a: noderes.node: rra001a
|
||||
|
||||
|
@ -179,8 +179,10 @@ sub mknetboot {
|
||||
next;
|
||||
}
|
||||
my $restab = xCAT::Table->new('noderes');
|
||||
my $bptab = xCAT::Table->new('bootparams');
|
||||
my $hmtab = xCAT::Table->new('nodehm');
|
||||
my $ent = $restab->getNodeAttribs($node,['serialport','primarynic']);
|
||||
my $ent = $restab->getNodeAttribs($node,['primarynic']);
|
||||
my $sent = $hmtab->getNodeAttribs($node,['serialport','serialspeed','serialflow']);
|
||||
my $ient = $restab->getNodeAttribs($node,['servicenode']);
|
||||
my $ipfn = xCAT::Utils->my_ip_facing($node);
|
||||
if ($ient and $ient->{servicenode}) { #Servicenode attribute overrides
|
||||
@ -199,18 +201,18 @@ sub mknetboot {
|
||||
else {
|
||||
$kcmdline = "imgurl=http://$imgsrv/install/netboot/$osver/$arch/$profile/rootimg.$suffix ";
|
||||
}
|
||||
if (defined $ent->{serialport}) {
|
||||
my $sent = $hmtab->getNodeAttribs($node,['serialspeed','serialflow']);
|
||||
if (defined $sent->{serialport}) {
|
||||
#my $sent = $hmtab->getNodeAttribs($node,['serialspeed','serialflow']);
|
||||
unless ($sent->{serialspeed}) {
|
||||
$callback->({error=>["serialport defined, but no serialspeed for $node in nodehm table"],errorcode=>[1]});
|
||||
next;
|
||||
}
|
||||
$kcmdline .= "console=ttyS".$ent->{serialport}.",".$sent->{serialspeed};
|
||||
$kcmdline .= "console=ttyS".$sent->{serialport}.",".$sent->{serialspeed};
|
||||
if ($sent->{serialflow} =~ /(hard|tcs|ctsrts)/) {
|
||||
$kcmdline .= "n8r";
|
||||
}
|
||||
}
|
||||
$restab->setNodeAttribs($node,{
|
||||
$bptab->setNodeAttribs($node,{
|
||||
kernel=>"xcat/netboot/$osver/$arch/$profile/kernel",
|
||||
initrd=>"xcat/netboot/$osver/$arch/$profile/initrd.gz",
|
||||
kcmdline=>$kcmdline
|
||||
@ -305,9 +307,10 @@ sub mkinstall {
|
||||
}
|
||||
#We have a shot...
|
||||
my $restab = xCAT::Table->new('noderes');
|
||||
my $bptab = xCAT::Table->new('bootparams');
|
||||
my $hmtab = xCAT::Table->new('nodehm');
|
||||
my $ent = $restab->getNodeAttribs($node,['nfsserver','serialport','primarynic','installnic']);
|
||||
my $sent = $hmtab->getNodeAttribs($node,['serialspeed','serialflow']);
|
||||
my $ent = $restab->getNodeAttribs($node,['nfsserver','primarynic','installnic']);
|
||||
my $sent = $hmtab->getNodeAttribs($node,['serialport','serialspeed','serialflow']);
|
||||
unless ($ent and $ent->{nfsserver}) {
|
||||
$callback->({error=>["No noderes.nfsserver defined for ".$node],errorcode=>[1]});
|
||||
next;
|
||||
@ -322,19 +325,19 @@ sub mkinstall {
|
||||
}
|
||||
|
||||
#TODO: dd=<url> for driver disks
|
||||
if (defined($ent->{serialport})) {
|
||||
if (defined($sent->{serialport})) {
|
||||
unless ($sent->{serialspeed}) {
|
||||
$callback->({error=>["serialport defined, but no serialspeed for $node in nodehm table"],errorcode=>[1]});
|
||||
next;
|
||||
}
|
||||
$kcmdline.=" console=ttyS".$ent->{serialport}.",".$sent->{serialspeed};
|
||||
$kcmdline.=" console=ttyS".$sent->{serialport}.",".$sent->{serialspeed};
|
||||
if ($sent->{serialflow} =~ /(hard|cts|ctsrts)/) {
|
||||
$kcmdline .= "n8r";
|
||||
}
|
||||
}
|
||||
$kcmdline .= " noipv6";
|
||||
|
||||
$restab->setNodeAttribs($node,{
|
||||
$bptab->setNodeAttribs($node,{
|
||||
kernel=>"xcat/$os/$arch/vmlinuz",
|
||||
initrd=>"xcat/$os/$arch/initrd.img",
|
||||
kcmdline=>$kcmdline
|
||||
|
@ -89,7 +89,8 @@ sub setdestiny {
|
||||
unless ($state =~ /^netboot/) { $chaintab->setNodeAttribs($_,{currchain=>"boot"}); };
|
||||
}
|
||||
} elsif ($state eq "shell" or $state eq "standby" or $state =~ /^runcmd/ or $state =~ /^runimage/) {
|
||||
my $noderes=xCAT::Table->new('noderes');
|
||||
my $noderes=xCAT::Table->new('noderes',-create=>1);
|
||||
my $bootparms=xCAT::Table->new('bootparams',-create=>1);
|
||||
my $nodetype = xCAT::Table->new('nodetype');
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
my $nodehm = xCAT::Table->new('nodehm');
|
||||
@ -111,16 +112,16 @@ sub setdestiny {
|
||||
if ($ent and $ent->{xcatmaster}) {
|
||||
$master = $ent->{xcatmaster};
|
||||
}
|
||||
$ent = $noderes->getNodeAttribs($_,['serialport']);
|
||||
$ent = $nodehm->getNodeAttribs($_,['serialport','serialspeed','serialflow']);
|
||||
if ($ent and defined($ent->{serialport})) {
|
||||
$kcmdline .= "console=ttyS".$ent->{serialport};
|
||||
$ent = $nodehm->getNodeAttribs($_,['serialspeed']);
|
||||
#$ent = $nodehm->getNodeAttribs($_,['serialspeed']);
|
||||
unless ($ent and defined($ent->{serialspeed})) {
|
||||
$callback->({error=>["Serial port defined in noderes, but no nodehm.serialspeed set for $_"],errorcode=>[1]});
|
||||
return;
|
||||
}
|
||||
$kcmdline .= ",".$ent->{serialspeed};
|
||||
$ent = $nodehm->getNodeAttribs($_,['serialflow']);
|
||||
#$ent = $nodehm->getNodeAttribs($_,['serialflow']);
|
||||
if ($ent and ($ent->{serialflow} eq 'hard' or $ent->{serialflow} eq 'rtscts')) {
|
||||
$kcmdline .= "n8r";
|
||||
}
|
||||
@ -135,7 +136,7 @@ sub setdestiny {
|
||||
if ($portent and $portent->{value}) {
|
||||
$xcatdport = $portent->{value};
|
||||
}
|
||||
$noderes->setNodeAttribs($_,{kernel => "xcat/nbk.$arch",
|
||||
$bootparms->setNodeAttribs($_,{kernel => "xcat/nbk.$arch",
|
||||
initrd => "xcat/nbfs.$arch.gz",
|
||||
kcmdline => $kcmdline."xcatd=$master:$xcatdport"});
|
||||
}
|
||||
@ -266,16 +267,17 @@ sub getdestiny {
|
||||
$response{data}=[$ref->{currstate}];
|
||||
$response{destiny}=[$ref->{currstate}];
|
||||
my $sitetab= xCAT::Table->new('site');
|
||||
my $nrent = $noderestab->getNodeAttribs($node,[qw(tftpserver kernel initrd kcmdline xcatmaster)]);
|
||||
my $nrent = $noderestab->getNodeAttribs($node,[qw(tftpserver xcatmaster)]);
|
||||
my $bpent = $noderestab->getNodeAttribs($node,[qw(kernel initrd kcmdline xcatmaster)]);
|
||||
(my $sent) = $sitetab->getAttribs({key=>'master'},'value');
|
||||
if (defined $nrent->{kernel}) {
|
||||
$response{kernel}=$nrent->{kernel};
|
||||
if (defined $bpent->{kernel}) {
|
||||
$response{kernel}=$bpent->{kernel};
|
||||
}
|
||||
if (defined $nrent->{initrd}) {
|
||||
$response{initrd}=$nrent->{initrd};
|
||||
if (defined $bpent->{initrd}) {
|
||||
$response{initrd}=$bpent->{initrd};
|
||||
}
|
||||
if (defined $nrent->{kcmdline}) {
|
||||
$response{kcmdline}=$nrent->{kcmdline};
|
||||
if (defined $bpent->{kcmdline}) {
|
||||
$response{kcmdline}=$bpent->{kcmdline};
|
||||
}
|
||||
if (defined $nrent->{tftpserver}) {
|
||||
$response{imgserver}=$nrent->{tftpserver};
|
||||
|
@ -61,8 +61,8 @@ sub setstate {
|
||||
|
||||
=cut
|
||||
my $node = shift;
|
||||
my $restab = xCAT::Table->new('noderes');
|
||||
my $kern = $restab->getNodeAttribs($node,['kernel','initrd','kcmdline']);
|
||||
my $bptab = xCAT::Table->new('bootparams');
|
||||
my $kern = $bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']);
|
||||
my $pcfg;
|
||||
open($pcfg,'>',$tftpdir."/pxelinux.cfg/".$node);
|
||||
my $chaintab = xCAT::Table->new('chain');
|
||||
|
@ -178,17 +178,18 @@ sub mkinstall
|
||||
|
||||
#We have a shot...
|
||||
my $restab = xCAT::Table->new('noderes');
|
||||
my $bptab = xCAT::Table->new('bootparams');
|
||||
my $hmtab = xCAT::Table->new('nodehm');
|
||||
my $ent =
|
||||
$restab->getNodeAttribs(
|
||||
$node,
|
||||
[
|
||||
'nfsserver', 'serialport',
|
||||
'nfsserver',
|
||||
'primarynic', 'installnic'
|
||||
]
|
||||
);
|
||||
my $sent =
|
||||
$hmtab->getNodeAttribs($node, ['serialspeed', 'serialflow']);
|
||||
$hmtab->getNodeAttribs($node, ['serialport', 'serialspeed', 'serialflow']);
|
||||
unless ($ent and $ent->{nfsserver})
|
||||
{
|
||||
$callback->(
|
||||
@ -221,7 +222,7 @@ sub mkinstall
|
||||
}
|
||||
|
||||
#TODO: driver disk handling should in SLES case be a mod of the install source, nothing to see here
|
||||
if (defined $ent->{serialport})
|
||||
if (defined $sent->{serialport})
|
||||
{
|
||||
unless ($sent->{serialspeed})
|
||||
{
|
||||
@ -237,7 +238,7 @@ sub mkinstall
|
||||
}
|
||||
$kcmdline .=
|
||||
" console=ttyS"
|
||||
. $ent->{serialport} . ","
|
||||
. $sent->{serialport} . ","
|
||||
. $sent->{serialspeed};
|
||||
if ($sent and ($sent->{serialflow} =~ /(ctsrts|cts|hard)/))
|
||||
{
|
||||
@ -247,7 +248,7 @@ sub mkinstall
|
||||
|
||||
if ($arch =~ /x86/)
|
||||
{
|
||||
$restab->setNodeAttribs(
|
||||
$bptab->setNodeAttribs(
|
||||
$node,
|
||||
{
|
||||
kernel => "xcat/$os/$arch/linux",
|
||||
@ -258,7 +259,7 @@ sub mkinstall
|
||||
}
|
||||
elsif ($arch =~ /ppc/)
|
||||
{
|
||||
$restab->setNodeAttribs(
|
||||
$bptab->setNodeAttribs(
|
||||
$node,
|
||||
{
|
||||
kernel => "xcat/$os/$arch/inst64",
|
||||
|
@ -63,8 +63,8 @@ sub setstate {
|
||||
|
||||
=cut
|
||||
my $node = shift;
|
||||
my $restab = xCAT::Table->new('noderes');
|
||||
my $kern = $restab->getNodeAttribs($node,['kernel','initrd','kcmdline']);
|
||||
my $bptab = xCAT::Table->new('bootparams');
|
||||
my $kern = $bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']);
|
||||
my $pcfg;
|
||||
unless (-d "$tftpdir/etc") {
|
||||
mkpath("$tftpdir/etc");
|
||||
|
@ -219,15 +219,15 @@ if ($inet6support) {
|
||||
my $kcmdline;
|
||||
($kname,$iname,$kcmdline) = split(/\s+/,$text,3);
|
||||
chomp($kcmdline);
|
||||
my $noderestab = xCAT::Table->new('noderes',-create=>1);
|
||||
$noderestab->setNodeAttribs($node,{kernel=>"xcat/$node/$kname",initrd=>"xcat/$node/$iname",kcmdline=>$kcmdline});
|
||||
my $bptab = xCAT::Table->new('bootparams',-create=>1);
|
||||
$bptab->setNodeAttribs($node,{kernel=>"xcat/$node/$kname",initrd=>"xcat/$node/$iname",kcmdline=>$kcmdline});
|
||||
my $iscsitab = xCAT::Table->new('iscsi',-create=>1);
|
||||
$iscsitab->setNodeAttribs($node,{kernel=>"xcat/$node/$kname",initrd=>"xcat/$node/$iname",kcmdline=>$kcmdline});
|
||||
my $chaintab = xCAT::Table->new('chain',-create=>1);
|
||||
$chaintab->setNodeAttribs($node,{currstate=>'iscsiboot',currchain=>'netboot'});
|
||||
$noderestab->close;
|
||||
$bptab->close;
|
||||
$chaintab->close;
|
||||
undef $noderestab;
|
||||
undef $bptab;
|
||||
undef $chaintab;
|
||||
my %request = (
|
||||
command => [ 'nodeset' ],
|
||||
|
Loading…
Reference in New Issue
Block a user