-Implement rebuild of tftp directory contents if appropriate in AAsn
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3023 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
2c970102c5
commit
74ff7bb8e3
@ -933,6 +933,44 @@ sub setup_TFTP
|
||||
xCAT::MsgUtils->message("S", "Error $cmd");
|
||||
}
|
||||
}
|
||||
} else { #if not mounting, have to regenerate....
|
||||
#first, run mknb to get nbfs and such going?
|
||||
my $cmdref;
|
||||
$cmdref->{command}->[0] = "mknb";
|
||||
$cmdref->{arg}->[0] = "ppc64";
|
||||
${"xCAT_plugin::mknb::"}{process_request}->($cmdref, \&xCAT::Client::handle_response);
|
||||
$cmdref->{arg}->[0] = "x86";
|
||||
${"xCAT_plugin::mknb::"}{process_request}->($cmdref, \&xCAT::Client::handle_response);
|
||||
$cmdref->{arg}->[0] = "x86_64";
|
||||
${"xCAT_plugin::mknb::"}{process_request}->($cmdref, \&xCAT::Client::handle_response);
|
||||
#now, run nodeset enact on
|
||||
#now, run nodeset enact on
|
||||
my $mactab = xCAT::Table->new('mac');
|
||||
my $hmtab = xCAT::Table->new('nodehm');
|
||||
if ($mactab and $hmtab) {
|
||||
my @mentries = ($mactab->getAllNodeAttribs([qw(node mac)])); #nodeset fails if no mac entry, filter on discovered nodes first...
|
||||
my %netmethods;
|
||||
my @tnodes;
|
||||
foreach (@mentries) {
|
||||
unless (defined $_->{mac}) { next; }
|
||||
push @tnodes,$_->{node};
|
||||
}
|
||||
my %hmhash = %{$hmtab->getNodesAttribs(\@tnodes,[qw(node netboot)])};
|
||||
foreach (@tnodes) {
|
||||
if ($hmhash{$_}->[0]->{netboot}) {
|
||||
push $netmethods{$hmhash{$_}->[0]->{netboot}},$_;
|
||||
}
|
||||
}
|
||||
$cmdref->{command}->[0] = "nodeset";
|
||||
$cmdref->{arg}->[0] = "enact";
|
||||
$cmdref->{cwd}->[0] = "/opt/xcat/sbin";
|
||||
foreach my $modname (keys %netmethods) {
|
||||
$cmdref->{node} = $netmethods{$modname};
|
||||
print Dumper($cmdref);
|
||||
${"xCAT_plugin::" . $modname . "::"}{process_request}->($cmdref, \&xCAT::Client::handle_response);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# start atftp
|
||||
|
@ -74,12 +74,29 @@ sub relay_response {
|
||||
sub setdestiny {
|
||||
my $req=shift;
|
||||
my $flag=shift;
|
||||
my $noupdate=shift;
|
||||
|
||||
$chaintab = xCAT::Table->new('chain',-create=>1);
|
||||
my @nodes=@{$req->{node}};
|
||||
my $state = $req->{arg}->[0];
|
||||
my %nstates;
|
||||
if ($state eq "next") {
|
||||
if ($state eq "enact") {
|
||||
my %nodestates;
|
||||
my %stents = %{$chaintab->getNodesAttribs($req->{node},"currstate")};
|
||||
my $state;
|
||||
foreach (@{$req->{node}}) { #First, build a hash of all of the states to attempt to keep things as aggregated as possible
|
||||
if ($stents{$_}->[0]->{currstate}) {
|
||||
$state = $stents{$_}->[0]->{currstate};
|
||||
$state =~ s/ .*//;
|
||||
push $nodestates{$state},$_;
|
||||
}
|
||||
}
|
||||
foreach (keys %nodestates) {
|
||||
$req->{arg}->[0]=$_;
|
||||
setdestiny($req,30,1); #ludicrous flag to denote no table updates can be inferred.
|
||||
}
|
||||
return;
|
||||
} elsif ($state eq "next") {
|
||||
return nextdestiny($flag + 1); #this is special case where updateflag is called
|
||||
} elsif ($state eq "iscsiboot") {
|
||||
my $iscsitab=xCAT::Table->new('iscsi');
|
||||
@ -190,6 +207,7 @@ sub setdestiny {
|
||||
$callback->({error=>["Unknown state $state requested"],errorcode=>[1]});
|
||||
return;
|
||||
}
|
||||
if ($noupdate) { return; } #skip table manipulation if just doing 'enact'
|
||||
foreach (@nodes) {
|
||||
my $lstate = $state;
|
||||
if ($nstates{$_}) {
|
||||
|
@ -310,7 +310,7 @@ sub process_request {
|
||||
} else {
|
||||
@args=($request->{arg});
|
||||
}
|
||||
unless ($args[0] eq 'stat' or $args[0] eq 'enact') {
|
||||
unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') {
|
||||
$sub_req->({command=>['setdestiny'],
|
||||
node=>\@nodes,
|
||||
arg=>[$args[0]]},\&pass_along);
|
||||
|
@ -289,7 +289,7 @@ sub process_request {
|
||||
return;
|
||||
}
|
||||
|
||||
unless ($args[0] eq 'stat' or $args[0] eq 'enact') {
|
||||
unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') {
|
||||
$sub_req->({command=>['setdestiny'],
|
||||
node=>\@nodes,
|
||||
arg=>[$args[0]]},\&pass_along);
|
||||
|
Loading…
Reference in New Issue
Block a user