2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 01:26:38 +00:00

update node status when enter shell/standby

This commit is contained in:
XuWei 2018-04-24 03:47:45 -04:00
parent 38d36145ce
commit 9d5dede0d1
2 changed files with 22 additions and 7 deletions

View File

@ -319,6 +319,11 @@ if [ "$destiny" != "discover" ]; then #we aren't discoverying, we probably can a
logger -s -t $log_label -p local4.info "Getting initial certificate --> $XCATMASTER:$XCATPORT"
/bin/getcert $XCATMASTER:$XCATPORT
fi
if [ "$destiny" ]; then
# run getdestiny to update node status
/bin/getdestiny $XCATMASTER:$XCATPORT >/dev/null 2>&1
fi
while :; do
grepconfigraid=`echo $destiny|grep "configraid"`
@ -389,7 +394,7 @@ while :; do
tar xvf `basename $destparameter`
./runme.sh
cd -
logger -s -t $log_label -p local4.info "Running nextdestiny $XCATMASTER:$XCATPORT..."
logger -s -t $log_label -p local4.info "Running nextdestiny $XCATMASTER:$XCATPORT..."
destiny=`/bin/nextdestiny $XCATMASTER:$XCATPORT`
dest=`echo $destiny|awk -F= '{print $1}'`
logger -s -t $log_label -p local4.info "nextdestiny - Complete."

View File

@ -915,6 +915,16 @@ sub getdestiny {
my %node_status = ();
foreach $node (@$nodes) {
unless ($chaintab) { #Without destiny, have the node wait with ssh hopefully open at least
my $stat = xCAT_monitoring::monitorctrl->getNodeStatusFromNodesetState("standby", "getdestiny");
if ($stat) {
if (exists($node_status{$stat})) {
push @{ $node_status{$stat} }, $node;
} else {
$node_status{$stat} = [$node];
}
xCAT_monitoring::monitorctrl::setNodeStatusAttributes(\%node_status, 1);
}
$callback->({ node => [ { name => [$node], data => ['standby'], destiny => ['standby'] } ] });
return;
}
@ -928,10 +938,10 @@ sub getdestiny {
#print "node=$node, stat=$stat\n";
if ($stat) {
if (exists($node_status{$stat})) {
my $pa = $node_status{$stat};
push(@$pa, $node);
push @{ $node_status{$stat} }, $node;
} else {
$node_status{$stat} = [$node];
}
else { $node_status{$stat} = [$node]; }
}
}
@ -979,10 +989,10 @@ sub getdestiny {
#print "node=$node, stat=$stat\n";
if ($stat) {
if (exists($node_status{$stat})) {
my $pa = $node_status{$stat};
push(@$pa, $node);
push @{ $node_status{$stat} }, $node;
} else {
$node_status{$stat} = [$node];
}
else { $node_status{$stat} = [$node]; }
}
}