Commit e53e402f authored by David Johnson's avatar David Johnson

Bugfix for plab nodes. This problem was tripped by Kevin. What was

happening was that when Kevin swapmod'd to get rid of failed nodes,
he just took the bad ones out.  This forced a change in the
vname<->vnode mapping, and the failed node got put in a state
(RES_INIT_CLEAN) that vnode_setup couldn't handle for plab nodes.
Basically, the problem is that vnode_setup was assuming that the
RES_INIT_CLEAN meant that the plab vnode needed to be allocated --
but it was already allocated in the previous swap.
parent ed8e2ca5
......@@ -295,6 +295,29 @@ foreach my $node (@nodes) {
# this would move up into os_setup.
$mode = "reboot";
}
elsif ($plab && $allocstate eq TBDB_ALLOCSTATE_RES_INIT_CLEAN()) {
# This is a special case. If we reuse one of the plab
# nodes, but use a different vname in the topo, there will
# be an entry in the database and a slice will be reserved
# because it's never torn down. However, we need to
# skip plabnode alloc and go straight to vnodesetup.
#
# BUT, we only can do this if the sliver entry is already
# in the database!
# Also note that this could eventually cause problems
# if there is a mistaken sliver entry in the DB.
$res = DBQueryFatal(
"select slicename,node_id from plab_slice_nodes" .
" where pid='$pid' and eid='$eid' " .
" and node_id='$node'");
if ($res->numrows == 1) {
# node exists; change mode to resetup
$mode = "resetup";
print "Doing a resetup on '$node'\n";
}
}
}
}
}
......@@ -395,7 +418,7 @@ while (1) {
$args .= ($jailed ? "-j " : " ");
$args .= ($plab ? "-p " : " ");
$args .= "$vnode ";
$exval = TBForkCmd("$ssh -host $vnode ".
"$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