Commit 47cada5a authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Force virtual nodes into SHUTDOWN state when being free'ed (for real).

The intent is to avoid lots of silly stated warnings about virtual
nodes that do not exist outside the life of an experiment, and for a
number of reasons, can end up in odd event states while.
parent 4c85b0c4
......@@ -230,13 +230,13 @@ foreach my $n (@freed_nodes) {
# Find the default values for its node type.
my $result =
DBQueryFatal("select nt.osid, " .
DBQueryFatal("select nt.osid,n.eventstate, " .
" nt.isvirtnode, nt.imageable, o.mustclean ".
" from nodes as n " .
"left join node_types as nt on n.type=nt.type " .
"left join os_info as o on o.osid=n.def_boot_osid ".
"where node_id='$n'");
my ($osid, $isvirt, $imageable, $clean) = $result->fetchrow_array();
my ($osid, $estate, $isvirt, $imageable, $clean) = $result->fetchrow_array();
# See if the OS it was running was marked as mustclean or not. Basically,
# this is an OSKit hack to avoid reloading disks that have not been
......@@ -276,6 +276,14 @@ foreach my $n (@freed_nodes) {
"sfshostid=NULL,allocstate='$allocFreeState' ".
"where node_id='$n'") || $error++;
# If the node is a virtnode, force its state to SHUTDOWN. This is mostly
# to avoid silly stated warnings for nodes that do not have a physical
# representation most of the time!
if ($isvirt && $estate ne TBDB_NODESTATE_SHUTDOWN());
# Clean out the current_reloads table (a just in case measure).
DBQueryWarn("delete from current_reloads where node_id='$n'") || $error++;
Supports Markdown
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