Commit 7f69f694 authored by Leigh B Stoller's avatar Leigh B Stoller

Add physnode_count and virtnode_count to instances and instance_history.

This info is in the manifest, but want the numbers available for DB
queries.
parent ecb3721b
......@@ -413,6 +413,7 @@ sub RecordHistory($)
" creator,creator_idx,creator_uuid,pid,pid_idx, ".
" aggregate_urn,public_url,created,now(), ".
" extension_count,extension_days, ".
" physnode_count,virtnode_count, ".
" servername,rspec,params,manifest ".
" from apt_instances where uuid='$uuid'")
or return -1;
......
......@@ -110,6 +110,8 @@ CREATE TABLE `apt_instance_history` (
`destroyed` datetime default NULL,
`extension_count` smallint(5) unsigned NOT NULL default '0',
`extension_days` smallint(5) unsigned NOT NULL default '0',
`physnode_count` smallint(5) unsigned NOT NULL default '0',
`virtnode_count` smallint(5) unsigned NOT NULL default '0',
`servername` tinytext,
`rspec` mediumtext,
`params` mediumtext,
......@@ -143,6 +145,8 @@ CREATE TABLE `apt_instances` (
`extension_adminonly` tinyint(1) NOT NULL default '0',
`extension_count` smallint(5) unsigned NOT NULL default '0',
`extension_days` smallint(5) unsigned NOT NULL default '0',
`physnode_count` smallint(5) unsigned NOT NULL default '0',
`virtnode_count` smallint(5) unsigned NOT NULL default '0',
`servername` tinytext,
`monitor_pid` int(11) default '0',
`rspec` mediumtext,
......
#
# APT Stuff.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_instances", "physnode_count")) {
DBQueryFatal("alter table apt_instances add ".
" `physnode_count` smallint(5) unsigned ".
" NOT NULL default '0' ".
" after extension_days");
}
if (!DBSlotExists("apt_instances", "virtnode_count")) {
DBQueryFatal("alter table apt_instances add ".
" `virtnode_count` smallint(5) unsigned ".
" NOT NULL default '0' ".
" after physnode_count");
}
if (!DBSlotExists("apt_instance_history", "physnode_count")) {
DBQueryFatal("alter table apt_instance_history add ".
" `physnode_count` smallint(5) unsigned ".
" NOT NULL default '0' ".
" after extension_days");
}
if (!DBSlotExists("apt_instance_history", "virtnode_count")) {
DBQueryFatal("alter table apt_instance_history add ".
" `virtnode_count` smallint(5) unsigned ".
" NOT NULL default '0' ".
" after physnode_count");
}
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
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