Commit 88926d1c authored by Mike Hibler's avatar Mike Hibler

Inner-elab role changes:

	'boss' -> 'boss+router'
	'ops'  -> 'ops+fs'
	'fs'      (new role)
	'router'  (new role)

These are in preparation for allowing configurations with split ops and fs
nodes (and sometime down the road, split boss and router nodes).

This checkin is just the DB state changes along with the scripts that look
at that state.  The Big One, which actually sets up separate nodes
automatically, is undergoing more testing but will be Coming Soon.
parent b29cd2f2
......@@ -196,7 +196,8 @@ while (<IF>) {
while (my %row = $query_result->fetchhash()) {
if (defined($row{"pid"}) &&
defined($row{"inner_elab_role"}) &&
$row{"inner_elab_role"} eq "boss") {
($row{"inner_elab_role"} eq "boss" ||
$row{"inner_elab_role"} eq "boss+router")) {
my $tag = $row{"pid"} . ":" . $row{"eid"};
$bossnodes{$tag} = $row{"IP"};
......
......@@ -1573,7 +1573,7 @@ CREATE TABLE reserved (
old_pid varchar(12) NOT NULL default '',
old_eid varchar(32) NOT NULL default '',
cnet_vlan int(11) default NULL,
inner_elab_role enum('boss','ops','node') default NULL,
inner_elab_role enum('boss','boss+router','router','ops','ops+fs','fs','node') default NULL,
inner_elab_boot tinyint(1) default '0',
mustwipe tinyint(4) NOT NULL default '0',
PRIMARY KEY (node_id),
......@@ -2179,7 +2179,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','ops','node') default NULL,
inner_elab_role enum('boss','boss+router','router','ops','ops+fs','fs','node') default NULL,
numeric_id int(11) default NULL,
KEY pid (pid,eid,vname)
) TYPE=MyISAM;
......
......@@ -703,7 +703,7 @@ REPLACE INTO table_regex VALUES ('firewall_rules','eid','text','redirect','exper
REPLACE INTO table_regex VALUES ('firewall_rules','fwname','text','redirect','virt_nodes:vname',0,0,NULL);
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','inner_elab_role','text','regex','^(boss|ops|node)$',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 ('experiments','elab_in_elab','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','elabinelab_cvstag','text','regex','^[-\\w\\@\\/\\.]+$',0,0,NULL);
REPLACE INTO table_regex VALUES ('images','imageid','text','regex','^[a-zA-Z0-9][-\\w\\.+]+$',0,45,NULL);
......
......@@ -2799,4 +2799,23 @@ last_net_act,last_cpu_act,last_ext_act);
weight float not null default 0.5, \
types text not null default "");
4.10:
4.10: New inner_elab roles to support separate ops and fs nodes.
While I'm here, add future roles for distinguishing boss and the router.
Then update the virt_nodes and reserved tables to map old values of
boss/ops to new values of boss+router/ops+fs.
alter table virt_nodes change inner_elab_role \
inner_elab_role enum('boss','boss+router','router',\
'ops','ops+fs','fs','node') default NULL;
alter table reserved change inner_elab_role \
inner_elab_role enum('boss','boss+router','router',\
'ops','ops+fs','fs','node') default NULL;
update virt_nodes set inner_elab_role='boss+router'
where inner_elab_role='boss';
update virt_nodes set inner_elab_role='ops+fs'
where inner_elab_role='ops';
update reserved set inner_elab_role='boss+router'
where inner_elab_role='boss';
update reserved set inner_elab_role='ops+fs'
where inner_elab_role='ops';
......@@ -83,6 +83,8 @@ my $workdir;
my %noderoles = ();
my $opsnode;
my $bossnode;
my $fsnode;
my $routernode;
my @expnodes = ();
my $dbuid;
my $user_name;
......@@ -233,9 +235,13 @@ while (my ($node_id,$role) = $query_result->fetchrow_array()) {
$noderoles{$node_id} = $role;
$bossnode = $node_id
if ($role eq 'boss');
if ($role eq 'boss' || $role eq 'boss+router');
$routernode = $node_id
if ($role eq 'router');
$opsnode = $node_id
if ($role eq 'ops');
if ($role eq 'ops' || $role eq 'ops+fs');
$fsnode = $node_id
if ($role eq 'fs');
push(@expnodes, $node_id)
if ($role eq 'node');
}
......
......@@ -5,8 +5,8 @@
set myboss [$ns node]
set myops [$ns node]
tb-set-node-inner-elab-role $myboss boss
tb-set-node-inner-elab-role $myops ops
tb-set-node-inner-elab-role $myboss boss+router
tb-set-node-inner-elab-role $myops ops+fs
if {[info exists ::TBCOMPAT::elabinelab_hardware("boss")]} {
namespace eval TBCOMPAT {
......@@ -125,6 +125,3 @@ if {[info exists ::TBCOMPAT::elabinelab_nodeos("ops")]} {
} else {
tb-set-node-os $myops FBSD-STD
}
......@@ -1475,8 +1475,8 @@ proc tb-set-node-inner-elab-role {node role} {
perror "\[tb-set-node-inner-elab-role] $node is not a node."
return
}
if {[lsearch -exact {boss ops node} $role] == -1} {
perror "\[tb-set-node-inner-elab-role] type must be one of boss|ops|node"
if {[lsearch -exact {boss boss+router router ops ops+fs fs node} $role] == -1} {
perror "\[tb-set-node-inner-elab-role] type must be one of boss|boss+router|router|ops|ops+fs|fs|node"
return
}
$node set inner_elab_role $role
......@@ -1523,4 +1523,3 @@ proc tb-set-node-id {vnode myid} {
}
$vnode set_numeric_id $myid
}
......@@ -209,6 +209,14 @@ sub doboot()
}
}
#
# XXX temporary backward compat til these varients get implemented
#
$emulabconfig{"ROLE"} = "boss"
if ($emulabconfig{"ROLE"} eq "boss+router");
$emulabconfig{"ROLE"} = "ops"
if ($emulabconfig{"ROLE"} eq "ops+fs");
#
# XXX To avoid NFS errors while copying goo from outer boss.
#
......
......@@ -5513,13 +5513,13 @@ COMMAND_PROTOTYPE(doemulabconfig)
while (nrows--) {
row = mysql_fetch_row(res);
if (!strcmp(row[1], "boss")) {
if (!strcmp(row[1], "boss") || !strcmp(row[1], "boss+router")) {
bufp += OUTPUT(bufp, ebufp - bufp, "BOSSNODE=%s\n",
row[3]);
bufp += OUTPUT(bufp, ebufp - bufp, "BOSSIP=%s\n",
row[2]);
}
else if (!strcmp(row[1], "ops")) {
else if (!strcmp(row[1], "ops") || !strcmp(row[1], "ops+fs")) {
bufp += OUTPUT(bufp, ebufp - bufp, "OPSNODE=%s\n",
row[3]);
bufp += OUTPUT(bufp, ebufp - bufp, "OPSIP=%s\n",
......
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