All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit dfcfcdee authored by Leigh B. Stoller's avatar Leigh B. Stoller

Handle "virtual" widearea nodes that are neither jailed nor a

plabslice, but still sorta behave like one.

Also put back some code that must have been removed at some point, to
initiate vnode setup on remote nodes (since we do not reboot widearea
nodes; they are are always allocated and up).
parent 326ef48a
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group. # Copyright (c) 2000-2004, 2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
use English; use English;
...@@ -186,12 +186,13 @@ foreach my $node (@nodes) { ...@@ -186,12 +186,13 @@ foreach my $node (@nodes) {
my $plab; my $plab;
my $allocstate; my $allocstate;
my $mode = ($killmode ? "teardown" : "setup"); my $mode = ($killmode ? "teardown" : "setup");
my $remote = TBIsNodeRemote($node);
if (! TBIsNodeVirtual($node, \$jailed, \$plab)) { if (! TBIsNodeVirtual($node, \$jailed, \$plab)) {
next; next;
} }
if (($plabonly || $jailonly) and if (($plabonly || $jailonly) and
!($plabonly && $plab or $jailonly && $jailed)) { !(($plabonly && $plab) || ($jailonly && ($jailed || $remote)))) {
next; next;
} }
if (! TBPhysNodeID($node, \$pnode)) { if (! TBPhysNodeID($node, \$pnode)) {
...@@ -210,7 +211,7 @@ foreach my $node (@nodes) { ...@@ -210,7 +211,7 @@ foreach my $node (@nodes) {
# #
# When swapping, local vnodes go down with the physnode. # When swapping, local vnodes go down with the physnode.
# #
if (! TBIsNodeRemote($node)) { if (! $remote) {
print "$node will $mode with local node $pnode.\n"; print "$node will $mode with local node $pnode.\n";
next; next;
} }
...@@ -239,7 +240,7 @@ foreach my $node (@nodes) { ...@@ -239,7 +240,7 @@ foreach my $node (@nodes) {
# assumed that these booted okay, and need to be torndown, # assumed that these booted okay, and need to be torndown,
# even though they are not RES_READY. # even though they are not RES_READY.
# #
if (! TBIsNodeRemote($node)) { if (! $remote) {
if ($killmode) { if ($killmode) {
if ($allocstate eq TBDB_ALLOCSTATE_DOWN) { if ($allocstate eq TBDB_ALLOCSTATE_DOWN) {
print "$node failed to boot; skipping $mode.\n"; print "$node failed to boot; skipping $mode.\n";
...@@ -391,35 +392,41 @@ while (1) { ...@@ -391,35 +392,41 @@ while (1) {
# Must change our real UID to root so that ssh will work. # Must change our real UID to root so that ssh will work.
$UID = 0; $UID = 0;
if ($plab && $mode eq "setup") { if ($mode eq "setup" && ($plab || !$jailed)) {
# Make sure vnode is in the proper state before trying to # Make sure vnode is in the proper state before trying to
# bring it up. # bring it up.
# XXX: do this for all vnodes (see above)? # XXX: do this for all vnodes (see above)?
TBSetNodeEventState($vnode, TBDB_NODESTATE_SHUTDOWN); TBSetNodeEventState($vnode, TBDB_NODESTATE_SHUTDOWN);
if (TBForkCmd("$TB/sbin/plabnode ". if ($plab) {
($force ? "-f" : ""). if (TBForkCmd("$TB/sbin/plabnode ".
" alloc $pid $eid $vnode", 1)) { ($force ? "-f" : "").
print STDERR "*** $0:\n" . " alloc $pid $eid $vnode", 1)) {
" Plab node allocation failed\n"; print STDERR "*** $0:\n" .
# Should check DB state instead. " Plab node allocation failed\n";
exit(99); # Should check DB state instead.
exit(99);
}
}
else {
if (TBForkCmd("$ssh -host $pnode $CLIENT_BIN/vnodesetup ".
" -i $vnode", 1)) {
exit(99);
}
} }
# Make sure the system knows we now have state on the node! # Make sure the system knows we now have state on the node!
TBSetNodeAllocState($vnode, TBDB_ALLOCSTATE_RES_INIT_DIRTY); TBSetNodeAllocState($vnode, TBDB_ALLOCSTATE_RES_INIT_DIRTY);
} }
elsif (!($plab && ($mode eq "cleanup" || $mode eq "teardown"))) {
# Cleanup is used only on plab nodes. # Cleanup is used only on plab nodes.
# Don't try to teardown plab vnodes; it's just asking for # Don't try to teardown plab vnodes; it's just asking for
# trouble as the shutdown may hang or take too long. It's # trouble as the shutdown may hang or take too long. It's
# best to simply try and free the vserver below. # best to simply try and free the vserver below.
if (!($plab && ($mode eq "cleanup" || $mode eq "teardown"))) {
my $args = (($mode eq "teardown") ? "-k " : my $args = (($mode eq "teardown") ? "-k " :
($mode eq "reboot" ? "-r " : " ")); ($mode eq "reboot" ? "-r " : " "));
$args .= ($jailed ? "-j " : " "); $args .= ($jailed ? "-j " : ($plab ? "-p " : "-i "));
$args .= ($plab ? "-p " : " ");
$args .= "$vnode "; $args .= "$vnode ";
$exval = TBForkCmd("$ssh -host $vnode ". $exval = TBForkCmd("$ssh -host $pnode ".
"$CLIENT_BIN/vnodesetup $args",1); "$CLIENT_BIN/vnodesetup $args",1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment