Commit 471d1d26 authored by Kirk Webb's avatar Kirk Webb

Change the way vnode_setup handles plab nodes a bit to avoid a couple of

buggy situations.

  * Don't try vnodesetup -h on plab nodes

This can hang, or even fail.  Since nothing useful is conveyed by this
step, just skip it, set the node's state to SHUTDOWN, and ask pl_conf
on the node to remove the vserver.

  * Set plab node's alloc state to TBDB_ALLOCSTATE_RES_INIT_DIRTY after
    instantiation.

This avoids a bug where Emulab cluster nodes fail to come up, and so
os_setup never waits on the plab vnodes (now that they are started in
parallel with physical node setup).  Previously their alloc state made
them look clean, and so the vservers would not be reaped during
teardown.
parent 12067513
......@@ -381,10 +381,15 @@ while (1) {
# Should check DB state instead.
exit(99);
}
# Make sure the system knows we now have state on the node!
TBSetNodeAllocState($vnode, TBDB_ALLOCSTATE_RES_INIT_DIRTY);
}
# Cleanup is used only on plab nodes.
if ($mode ne "cleanup") {
# Don't try to teardown plab vnodes; it's just asking for
# trouble as the shutdown may hang or take too long. It's
# best to simply try and free the vserver below.
if (!($plab && ($mode eq "cleanup" || $mode eq "teardown"))) {
my $args = (($mode eq "teardown") ? "-k " :
($mode eq "reboot" ? "-r " : " "));
$args .= ($jailed ? "-j " : " ");
......@@ -397,6 +402,7 @@ while (1) {
# Free the plab node lease if necessary.
if ($plab && ($mode eq "teardown" || $mode eq "cleanup")) {
TBSetNodeEventState($vnode, TBDB_NODESTATE_SHUTDOWN);
exec("$TB/sbin/plabnode free $pid $eid $vnode");
die("*** $0:\n".
" exec failed!\n");
......
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