Commit 949ee392 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add check for experiment wide jail_osname and delay_osname (set in the

parser with new functions tb-set-jail-os() and tb-set-delay-os()).
Prefer these over anything in the node_types table. Makes it easier to
test new images in the various configurations.
parent 47d55472
......@@ -255,6 +255,10 @@ my $multiplex_factor;
my $cpu_usage;
my $mem_usage;
# Allow override of jail/delay osids.
my $jail_osid;
my $delay_osid;
######################################################################
# ips is indexed by node:port and contains the IP address for the port.
......@@ -2166,7 +2170,12 @@ sub InitPnode($pnode, $vnode)
#
# A delay node.
#
if (defined($delay_osid)) {
$osid = $delay_osid;
}
else {
$osid = nodedelayosid(physnodetype($pnode));
}
$expt_stats{"delaynodes"} += 1;
$vname = $vnode;
$role = TBDB_RSRVROLE_DELAYNODE;
......@@ -2176,7 +2185,12 @@ sub InitPnode($pnode, $vnode)
#
# A node hosting jails
#
if (defined($jail_osid)) {
$osid = $jail_osid;
}
else {
$osid = nodejailosid(physnodetype($pnode));
}
$expt_stats{"jailnodes"} += 1;
#
# Set the vname to something useful.
......@@ -3249,11 +3263,13 @@ sub LoadExperiment()
my $query_result =
DBQueryFatal("select uselinkdelays,forcelinkdelays,".
" multiplex_factor,usewatunnels, ".
" cpu_usage,mem_usage ".
" cpu_usage,mem_usage, ".
" jail_osname,delay_osname ".
" from experiments ".
"where pid='$pid' and eid='$eid'");
my ($o1,$o2,$o3,$o4,$o5,$o6) = $query_result->fetchrow_array();
my ($o1,$o2,$o3,$o4,$o5,$o6,$jail_osname,$delay_osname) =
$query_result->fetchrow_array();
# Do not override settings if already defined above.
$uselinkdelays = $o1
......@@ -3268,6 +3284,20 @@ sub LoadExperiment()
if (!defined($cpu_usage));
$mem_usage = $o6
if (!defined($mem_usage));
if (!defined($jail_osid) && defined($jail_osname)) {
if (! ($jail_osid = TBOSID($pid, $jail_osname)) &&
! ($jail_osid = TBOSID(TB_OPSPID, $jail_osname))) {
fatal($WRAPPER_FAILED|$WRAPPER_FAILED_CANRECOVER,
"Invalid OS $jail_osname in project $pid!");
}
}
if (!defined($delay_osid) && defined($delay_osname)) {
if (! ($delay_osid = TBOSID($pid, $delay_osname)) &&
! ($delay_osid = TBOSID(TB_OPSPID, $delay_osname))) {
fatal($WRAPPER_FAILED|$WRAPPER_FAILED_CANRECOVER,
"Invalid OS $delay_osname in project $pid!");
}
}
LoadVirtTypes();
LoadVirtNodes();
......
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