Commit 43014370 authored by Leigh B Stoller's avatar Leigh B Stoller

1. Change elab role from enums to tinytext.

2. Add a new inner_elab_role; boss+fs+router which makes boss the FSNODE
3. Add loadlist to both virt_node and nodes for plumbing multi image load
   through from the NS parser.
parent 50cb41df
......@@ -2519,6 +2519,7 @@ CREATE TABLE `nodes` (
`rpms` text,
`deltas` text,
`tarballs` text,
`loadlist` text,
`startupcmd` tinytext,
`startstatus` tinytext,
`ready` tinyint(4) unsigned NOT NULL default '0',
......@@ -3382,7 +3383,7 @@ CREATE TABLE `reserved` (
`old_eid` varchar(32) NOT NULL default '',
`old_exptidx` int(11) NOT NULL default '0',
`cnet_vlan` int(11) default NULL,
`inner_elab_role` enum('boss','boss+router','router','ops','ops+fs','fs','node') default NULL,
`inner_elab_role` tinytext,
`inner_elab_boot` tinyint(1) default '0',
`plab_role` enum('plc','node','none') NOT NULL default 'none',
`plab_boot` tinyint(1) default '0',
......@@ -4340,6 +4341,7 @@ CREATE TABLE `virt_nodes` (
`exptidx` int(11) NOT NULL default '0',
`ips` text,
`osname` varchar(20) default NULL,
`loadlist` text,
`parent_osname` varchar(20) default NULL,
`cmd_line` text,
`rpms` text,
......@@ -4351,7 +4353,7 @@ CREATE TABLE `virt_nodes` (
`failureaction` enum('fatal','nonfatal','ignore') NOT NULL default 'fatal',
`routertype` enum('none','ospf','static','manual','static-ddijk','static-old') NOT NULL default 'none',
`fixed` text NOT NULL,
`inner_elab_role` enum('boss','boss+router','router','ops','ops+fs','fs','node') default NULL,
`inner_elab_role` tinytext,
`plab_role` enum('plc','node','none') NOT NULL default 'none',
`plab_plcnet` varchar(32) NOT NULL default 'none',
`numeric_id` int(11) default NULL,
......
......@@ -935,7 +935,7 @@ REPLACE INTO table_regex VALUES ('firewall_rules','fwname','text','redirect','vi
REPLACE INTO table_regex VALUES ('firewall_rules','ruleno','int','redirect','default:int',0,50000,NULL);
REPLACE INTO table_regex VALUES ('firewall_rules','rule','text','regex','^\\w[-\\w \\t,/\\{\\}\\(\\)!:\\.]*$',0,1024,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','role','text','regex','^(node|bridge)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','inner_elab_role','text','regex','^(boss|boss\\+router|router|ops|ops\\+fs|fs|node)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','inner_elab_role','text','regex','^(boss|boss\\+router|boss\\+fs\\+router|router|ops|ops\\+fs|fs|node)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','plab_role','text','regex','^(plc|node|none)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','elab_in_elab','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','elabinelab_singlenet','int','redirect','default:boolean',0,0,NULL);
......@@ -1059,6 +1059,7 @@ REPLACE INTO table_regex VALUES ('virt_node_motelog','logfileid','text','regex',
REPLACE INTO table_regex VALUES ('virt_node_motelog','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_node_motelog','eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO `table_regex` VALUES ('virt_nodes','plab_plcnet','text','regex','^[\\w\\_\\d]+$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','loadlist','text','regex','^[-\\w\\.+,]+$',2,256,NULL);
REPLACE INTO table_regex VALUES ('os_info','osid','text','regex','^[-\\w\\.+]+$',2,35,NULL);
REPLACE INTO table_regex VALUES ('os_info','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('os_info','pid_idx','text','redirect','projects:pid_idx',0,0,NULL);
......
#
# 1. Change elab role from enums to tinytext.
# 2. Add a new inner_elab_role; boss+fs+router which makes boss the FSNODE
# 3. Add loadlist to both virt_node and nodes for plumbing multi image load
# through from the NS parser.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (! DBSlotExists("virt_nodes", "loadlist")) {
DBQueryFatal("alter table virt_nodes add ".
" `loadlist` text after osname");
}
if (! DBSlotExists("nodes", "loadlist")) {
DBQueryFatal("alter table nodes add ".
" `loadlist` text after tarballs");
}
my $type = DBSlotType("virt_nodes", "inner_elab_role");
if (!$type) {
Fatal("Could not get type for 'inner_elab_role' in 'virt_nodes'");
}
if ($type =~ /boss/) {
DBQueryFatal("alter table virt_nodes modify inner_elab_role tinytext");
}
$type = DBSlotType("reserved", "inner_elab_role");
if (!$type) {
Fatal("Could not get type for 'inner_elab_role' in 'reserved'");
}
if ($type =~ /boss/) {
DBQueryFatal("alter table reserved modify inner_elab_role tinytext");
}
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_nodes','inner_elab_role','text','regex',".
"'^(boss|boss\\+router|boss\\+fs\\+router|router|ops|ops\\+fs|fs|node)\$',".
"0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_nodes','loadlist','text','regex', ".
" '^[-\\w\\.+,]+\$',2,256,NULL)");
return 0;
}
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