add per node consoleondemand

This commit is contained in:
Arif Ali 2014-01-29 21:47:09 +00:00
parent 179a62145b
commit 65470149e9
2 changed files with 21 additions and 3 deletions

View File

@ -536,7 +536,7 @@ nodegroup => {
},
},
nodehm => {
cols => [qw(node power mgt cons termserver termport conserver serialport serialspeed serialflow getmac cmdmapping comments disable)],
cols => [qw(node power mgt cons termserver termport conserver serialport serialspeed serialflow getmac cmdmapping consoleondemand comments disable)],
keys => [qw(node)],
tablespace =>'XCATTBS16K',
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.",
@ -553,6 +553,7 @@ nodehm => {
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: same as values for mgmt attribute.',
cmdmapping => 'The fully qualified name of the file that stores the mapping between PCM hardware management commands and xCAT/third-party hardware management commands for a particular type of hardware device. Only used by PCM.',
consoleondemand => 'This overrides the value from site.consoleondemand; (0=no, 1=yes). Default is the result from site.consoleondemand.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},
@ -1895,6 +1896,10 @@ my @nodeattrs = (
{attr_name => 'serialflow',
tabentry => 'nodehm.serialflow',
access_tabentry => 'nodehm.node=attr:node',
},
{attr_name => 'consoleondemand',
tabentry => 'nodehm.consoleondemand',
access_tabentry => 'nodehm.node=attr:node',
},
##################
# vpd table #

View File

@ -12,6 +12,7 @@ use strict;
use Data::Dumper;
my @cservers = qw(mrv cyclades);
my %termservers; #list of noted termservers
my $siteondemand; # The site value for consoleondemand
my $usage_string=
" makeconservercf [-d|--delete] noderange
@ -276,6 +277,10 @@ sub docfheaders {
my $site_entry = $entries[0];
if ( defined($site_entry) and $site_entry eq "yes" ) {
push @newheaders," options ondemand;\n";
$siteondemand=1;
}
else {
$siteondemand=0;
}
push @newheaders,"}\n";
@ -322,7 +327,7 @@ sub makeconservercf {
my $hmtab = xCAT::Table->new('nodehm');
my @cfgents1;# = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport']);
if (($nodes and @$nodes > 0) or $req->{noderange}->[0]) {
@cfgents1 = $hmtab->getNodesAttribs($nodes,['node','cons','serialport','mgt','conserver','termserver','termport']);
@cfgents1 = $hmtab->getNodesAttribs($nodes,['node','cons','serialport','mgt','conserver','termserver','termport','consoleondemand']);
# Adjust the data structure to make the result consistent with the getAllNodeAttribs() call we make if a noderange was not specified
my @tmpcfgents1;
foreach my $ent (@cfgents1)
@ -335,7 +340,7 @@ sub makeconservercf {
@cfgents1 = @tmpcfgents1
} else {
@cfgents1 = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport']);
@cfgents1 = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport','consoleondemand']);
}
@ -538,6 +543,14 @@ foreach my $node (sort keys %$cfgenthash) {
push @$content," exec $locerror".$::XCATROOT."/share/xcat/cons/".$cmeth." ".$node.";\n"
}
}
if (defined($cfgent->{consoleondemand})) {
if ($cfgent->{consoleondemand} && !$siteondemand ) {
push @$content," options ondemand;\n";
}
elsif (!$cfgent->{consoleondemand} && $siteondemand ) {
push @$content," options !ondemand;\n";
}
}
push @$content,"}\n";
push @$content,"#xCAT END $node CONS\n";
}