Commit 43e9f520 authored by Leigh Stoller's avatar Leigh Stoller

When creating vnodes, add a node_activity row.

When deleting, remove node_activity and other slothd slots.
Going to have slothd start reporting for individual VMs soon.
parent 5a657846
......@@ -2100,7 +2100,7 @@ sub CreateVnodes($$$)
# those. Must do this with tables locked, of course.
#
DBQueryFatal("lock tables nodes write, reserved write, ".
"node_status write, node_hostkeys write, ".
"node_status write, node_hostkeys write, node_activity write,".
"virt_node_public_addr write, virt_node_attributes read");
#
......@@ -2333,6 +2333,18 @@ sub CreateVnodes($$$)
goto bad;
}
$statement =
"insert into node_activity set ".
" node_id='$vnodeid'";
print STDERR "$statement\n"
if ($debug);
if (!$impotent && !DBQueryWarn($statement)) {
print STDERR "*** CreateVnodes: Could not create activity entry\n";
goto bad;
}
Node->MakeFake($vnodeid, \%nodesets, \%rsrvsets)
if ($impotent);
......@@ -2412,6 +2424,9 @@ sub CreateVnodes($$$)
DBQueryWarn("delete from nodes where node_id='$vnodeid'");
DBQueryWarn("delete from node_hostkeys where node_id='$vnodeid'");
DBQueryWarn("delete from node_status where node_id='$vnodeid'");
DBQueryWarn("delete from node_activity where node_id='$vnodeid'");
DBQueryWarn("delete from node_idlestats where node_id='$vnodeid'");
DBQueryWarn("delete from iface_counters where node_id='$vnodeid'");
}
}
DBQueryFatal("unlock tables");
......@@ -2449,7 +2464,10 @@ sub DeleteVnodes(@)
# reimaged now!
DBQueryWarn("delete from current_reloads where node_id='$vnodeid'");
DBQueryWarn("delete from partitions where node_id='$vnodeid'");
}
# Slothd updates/creates these records.
DBQueryWarn("delete from node_activity where node_id='$vnodeid'");
DBQueryWarn("delete from node_idlestats where node_id='$vnodeid'");
DBQueryWarn("delete from iface_counters where node_id='$vnodeid'"); }
return 0;
}
......
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