Commit aefe785a authored by Leigh Stoller's avatar Leigh Stoller

Add support for making OPS a jail on boss. This works for elabinelab,

but has not been tested for actual Emulab. A typical elabinelab NS
file would look like:
    
    source tb_compat.tcl
    set ns [new Simulator]
    
    tb-elab-in-elab 1
    tb-elabinelab-singlenet
    tb-elab-in-elab-topology opsvm
    tb-set-elabinelab-attribute CONFIG_WINDOWS 0
    
    namespace eval TBCOMPAT {
        set elabinelab_maxpcs 1
        set elabinelab_hardware("boss") pc3000
    }
    $ns run
parent 33b312d7
This diff is collapsed.
......@@ -52,8 +52,20 @@ my $GROUPROOT = "@GROUPSROOT_DIR@";
my $USERROOT = "@USERSROOT_DIR@";
my $SCRATCHROOT = "@SCRATCHROOT_DIR@";
my $SHAREROOT = "@SHAREROOT_DIR@";
my $NOSHAREDFS = @NOSHAREDFS@;
my $ELVIN_COMPAT= @ELVIN_COMPAT@;
# True if we are also the FS node
my $ISFS = ($BOSSNODE eq $FSNODE) ? 1 : 0;
# Is ops a VM on boss?
my $OPSVM_ENABLE = @OPSVM_ENABLE@;
my $OPSVM_MOUNTPOINT = "@OPSVM_MOUNTPOINT@";
# For /share export below.
my $CONTROL_NETWORK = "@CONTROL_NETWORK@";
my $CONTROL_NETMASK = "@CONTROL_NETMASK@";
#
# Some programs we use
#
......@@ -94,6 +106,8 @@ my $RCCONF = "/etc/rc.conf";
my $SYSLOG_CONF = "/etc/syslog.conf";
my $NEWSYSLOG_CONF = "/etc/newsyslog.conf";
my $INETD_CONF = "/etc/inetd.conf";
my $EXPORTS_FILE = "/etc/exports";
my $EXPORTS_HEAD = "$EXPORTS_FILE.head";
my $PROTOUSER_KEY = "$TOP_SRCDIR/install/elabman_dsa.pub";
my $ROOT_PRIVKEY = "/root/.ssh/id_rsa";
......@@ -181,15 +195,27 @@ my $CISCO_MIB_FTP = "ftp://ftp.cisco.com/pub/mibs/v2";
# And some lists that we use
#
my @TESTBED_DIRS = ($PREFIX);
my @EXPORTDIRS = ();
my @MOUNTPOINTS = ("$USERSVAR_DIR", "$OPSDIR_DIR",
"$USERROOT", "$PROJROOT", "$GROUPROOT");
my @MOUNTPOINTS = ("$USERROOT", "$PROJROOT", "$GROUPROOT");
if ($SHAREDIR) {
push(@MOUNTPOINTS, "$SHAREROOT");
}
if ($SCRATCHDIR) {
push(@MOUNTPOINTS, "$SCRATCHROOT");
}
#
# If we are the FS, then the above dirs already exist, but we *do*
# have to export them. Note that the only reason to make boss the
# FSNODE, is if ops is a VM on boss and there is no actual FSNODE.
#
if ($ISFS) {
@EXPORTDIRS = @MOUNTPOINTS;
@MOUNTPOINTS = ();
}
# But these always have to be mounted no matter where ops is.
push(@MOUNTPOINTS, "$USERSVAR_DIR", "$OPSDIR_DIR")
if (!$OPSVM_ENABLE);
my @LOGFILES = ("$LOGDIR/bootinfo.log", "$LOGDIR/tmcd.log",
"$LOGDIR/capture.log", "$LOGDIR/dhcpd.log", "$LOGDIR/capserver.log",
......@@ -256,18 +282,24 @@ else {
# a boss node. These are OS dependent as we upgrade.
#
my $BOSS_PORT = "emulab-boss-1.8";
my $FS_PORT = "emulab-fs-1.4";
if ($FBSD_MAJOR > 4) {
if ($FBSD_MAJOR > 7) {
# XXX someday...
$BOSS_PORT = "emulab-boss-4.0";
$FS_PORT = "emulab-fs-4.0";
} elsif ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2) {
$BOSS_PORT = "emulab-boss-3.1";
$FS_PORT = "emulab-fs-3.1";
} elsif ($FBSD_MAJOR == 7) {
$BOSS_PORT = "emulab-boss-3.0";
$FS_PORT = "emulab-fs-3.0";
} elsif ($FBSD_MAJOR == 6 && $FBSD_MINOR > 2) {
$BOSS_PORT = "emulab-boss-2.1";
$FS_PORT = "emulab-fs-2.1";
} else {
$BOSS_PORT = "emulab-boss-2.0";
$FS_PORT = "emulab-fs-2.0";
}
}
......@@ -331,7 +363,7 @@ my $domakes = 0;
my $password;
my %opts;
if (! getopts("P:p:bsw:", \%opts)) {
if (! getopts("P:p:bsw:F:", \%opts)) {
usage();
}
if (defined($opts{p})) {
......@@ -346,6 +378,9 @@ if (defined($opts{s})) {
if (defined($opts{w})) {
$password = $opts{w};
}
if (defined($opts{F})) {
$FS_PORT = $opts{F};
}
if (defined($opts{P})) {
$BOSS_PORT = $opts{P};
}
......@@ -576,6 +611,17 @@ Phase "ports", "Installing ports", sub {
};
}
};
if ($ISFS) {
Phase "fs-packages", "Installing FS packages", sub {
if (!ExecQuiet("$PKG_INFO -e $FS_PORT")) {
PhaseSkip("FS ports already installed");
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $FS_PORT");
};
}
PhaseSkip("Package directory provided; not installing from sources")
if ($packagedir);
......@@ -593,6 +639,16 @@ Phase "ports", "Installing ports", sub {
ExecQuietFatal("$PATCH -f -l -p0 -i $PHP4_PATCH");
};
}
if ($ISFS) {
Phase "fs-pinstall", "Installing FS ports (may take a while)", sub {
if (!ExecQuiet("$PKG_INFO -e $FS_PORT")) {
PhaseSkip("Ports already installed");
}
chdir "$PORTSMISCDIR/emulab-fs" or
PhaseFail "Unable to change to $PORTSMISCDIR/emulab-fs: $!";
ExecQuietFatal("make -DBATCH install");
};
}
PhaseFail("Please install ports manually, since some\n of them are " .
"interactive. Run: \n" .
" cd $PORTSMISCDIR/emulab-boss && make install\n" .
......@@ -1143,9 +1199,12 @@ else {
Phase "hosts", "Adding boss/ops/fs IP addresses to $HOSTS", sub {
DoneIfEdited($HOSTS);
my $hstr = "${BOSSNODE_IP}\t${BOSSNODE} boss".
"\n${USERNODE_IP}\t@OPS_NAMES";
if ($USERNODE ne $FSNODE) {
my $hstr = "${BOSSNODE_IP}\t${BOSSNODE} boss";
if ($ISFS) {
$hstr .= " fs";
}
$hstr .= "\n${USERNODE_IP}\t@OPS_NAMES";
if ($USERNODE ne $FSNODE && $BOSSNODE ne $FSNODE) {
$hstr .= "\n${FSNODE_IP}\t${FSNODE} fs";
}
AppendToFileFatal($HOSTS, $hstr);
......@@ -1153,7 +1212,7 @@ Phase "hosts", "Adding boss/ops/fs IP addresses to $HOSTS", sub {
Phase "resolve", "Checking to make sure names for boss/ops/fs resolve", sub {
my @hnames = (@OPS_NAMES, ${BOSSNODE}, "boss");
if ($USERNODE ne $FSNODE) {
if ($USERNODE ne $FSNODE && !$ISFS) {
push @hnames, ${FSNODE}, "fs";
}
foreach my $name (@hnames) {
......@@ -1168,7 +1227,80 @@ Phase "resolve", "Checking to make sure names for boss/ops/fs resolve", sub {
}
};
Phase "NFSmounts", "Setting up NFS mounts", sub {
Phase "exports", "Setting up exports", sub {
if (!$ISFS) {
PhaseSkip("Not FS Node");
}
Phase "ex.head", "Creating $EXPORTS_HEAD", sub {
DoneIfExists($EXPORTS_HEAD);
#
# Figure out which of these directories are on the same
# filesystems. Note: we cannot do /share on the same exports line
# as the other filesystems because of the RO mount below (trust me).
#
my @dirs;
# XXX /share is not a separate partition when opsvm/elabinelab
if (!($OPSVM_ENABLE && $ELABINELAB)) {
@dirs = grep(!/^$SHAREROOT$/, @EXPORTDIRS);
}
else {
@dirs = @EXPORTDIRS;
}
@dirs = map {`realpath $_`} @dirs;
chomp @dirs;
my %filesystems;
foreach my $dir (@dirs) {
my ($dev,@junk) = stat $dir;
push @{$filesystems{$dev}}, $dir;
}
#
# Use that knowledge to create lines for /etc/exports.head
#
my @exports_lines;
foreach my $key (keys %filesystems) {
push @exports_lines,
join(" ",@{$filesystems{$key}}) .
"\t$BOSSNODE -maproot=root";
}
# XXX /share is not a separate partition when opsvm/elabinelab
if (!($OPSVM_ENABLE && $ELABINELAB)) {
#
# /share is special. We want to export to boss read-write,
# but to the control network read-only.
#
my $realdir = `realpath $SHAREROOT`;
chomp($realdir);
push(@exports_lines,
"$realdir\t$BOSSNODE -maproot=root");
if (!$NOSHAREDFS) {
my ($a,$b,$c,$d) =
($CONTROL_NETWORK =~ /^(\d*)\.(\d*)\.(\d*)\.(\d*)/);
push(@exports_lines,
"$realdir\t-network ${a}.${b}.${c} ".
"-mask $CONTROL_NETMASK -maproot=root -ro -alldirs");
}
}
#
# Put them in exports.head, and copy that to /etc/exports
#
CreateFileFatal($EXPORTS_HEAD, @exports_lines);
ExecQuietFatal("cp $EXPORTS_HEAD $EXPORTS_FILE");
};
# XXX Newhup
Phase "mountd", "HUPing mountd", sub {
PhaseSkip("No new exports file") if PhaseWasSkipped("ex.head");
PhaseSkip("mountd not running")
unless `ps -auxw | grep mountd | grep -v grep`;
ExecQuietFatal("killall -HUP mountd");
};
};
Phase "Mounts", "Setting up NFS mounts", sub {
Phase "mountpoints", "Creating mountpoints", sub {
foreach my $dir (@MOUNTPOINTS) {
Phase $dir, $dir, sub {
......@@ -1183,20 +1315,25 @@ Phase "NFSmounts", "Setting up NFS mounts", sub {
my $nfsopt = "nosuid";
$nfsopt .= ",nodev"
if ($FBSD_MAJOR < 7);
my @lines = ("$FSNODE:$USERROOT\t\t$USERROOT\tnfs\trw,$nfsopt\t0\t0",
my @lines = ();
if (! $ISFS) {
@lines = ("$FSNODE:$USERROOT\t\t$USERROOT\tnfs\trw,$nfsopt\t0\t0",
"$FSNODE:$PROJROOT\t\t$PROJROOT\tnfs\trw,$nfsopt\t0\t0",
"$FSNODE:$GROUPROOT\t\t$GROUPROOT\tnfs\trw,$nfsopt\t0\t0",
"$FSNODE:$SHAREROOT\t\t$SHAREROOT\tnfs\trw,$nfsopt\t0\t0");
if ($SCRATCHDIR) {
push(@lines,
"$FSNODE:$SCRATCHROOT\t\t$SCRATCHROOT\tnfs\trw,$nfsopt\t0\t0");
"$FSNODE:$SCRATCHROOT\t\t$SCRATCHROOT\tnfs\trw,$nfsopt\t0\t0")
if ($SCRATCHDIR);
}
push(@lines,
if (!$OPSVM_ENABLE) {
push(@lines,
"$USERNODE:/usr/testbed\t\t$OPSDIR_DIR\tnfs\trw,soft,-b,$nfsopt\t0\t0",
"$USERNODE:/var\t\t$USERSVAR_DIR\tnfs\tro,soft,-b,$nfsopt\t0\t0");
}
AppendToFileFatal($FSTAB, @lines);
};
Phase "mounts", "Mounting NFS filesystems", sub {
Phase "mounts", "Mounting filesystems", sub {
foreach my $dir (@MOUNTPOINTS) {
Phase $dir, $dir, sub {
DoneIfMounted($dir);
......@@ -1204,6 +1341,20 @@ Phase "NFSmounts", "Setting up NFS mounts", sub {
};
}
};
if ($OPSVM_ENABLE) {
Phase "symlinks", "Symlinking to OPS VM", sub {
Phase $OPSDIR_DIR, $OPSDIR_DIR, sub {
PhaseSkip("exists")
if (-e $OPSDIR_DIR && -l $OPSDIR_DIR);
ExecQuietFatal("ln -s ${OPSVM_MOUNTPOINT}/usr/testbed $OPSDIR_DIR");
};
Phase $USERSVAR_DIR, $USERSVAR_DIR, sub {
PhaseSkip("exists")
if (-e $USERSVAR_DIR && -l $USERSVAR_DIR);
ExecQuietFatal("ln -s ${OPSVM_MOUNTPOINT}/var $USERSVAR_DIR");
};
};
}
};
#
......@@ -1303,6 +1454,9 @@ Phase "ssh", "Setting up root ssh from boss to ops", sub {
if ($USERNODE eq $FSNODE) {
PhaseSkip("FS node is ops node");
}
if ($BOSSNODE eq $FSNODE) {
PhaseSkip("FS node is boss node");
}
if (! ExecQuiet("$SSH -o 'BatchMode=yes' root\@${FSNODE} pwd")) {
PhaseSkip("Key already copied");
} else {
......@@ -1552,6 +1706,9 @@ Phase "named", "Setting up initial named configuration", sub {
if ($USERNODE eq $FSNODE) {
PhaseSkip("FS node is ops node");
}
if ($BOSSNODE eq $FSNODE) {
PhaseSkip("FS node is boss node");
}
ExecQuietFatal("$SCP $TOP_OBJDIR/named/resolv.conf.ops ".
" ${FSNODE}:/etc/resolv.conf");
};
......
......@@ -62,6 +62,9 @@ my $ELVIN_COMPAT= @ELVIN_COMPAT@;
# True if we are also the FS node
my $ISFS = ($USERNODE eq $FSNODE) ? 1 : 0;
# Are we a VM on boss?
my $OPSVM_ENABLE = @OPSVM_ENABLE@;
# For /share export below.
my $CONTROL_NETWORK = "@CONTROL_NETWORK@";
my $CONTROL_NETMASK = "@CONTROL_NETMASK@";
......@@ -831,6 +834,9 @@ Phase "NFSmounts", "Setting up NFS mounts", sub {
if ($ISFS) {
PhaseSkip("FSes are local");
}
if ($OPSVM_ENABLE) {
PhaseSkip("FSes are mounted from outside the VM");
}
Phase "mountpoints", "Creating mountpoints", sub {
foreach my $dir (@MOUNTPOINTS) {
......@@ -1078,8 +1084,10 @@ Phase "ssh", "Allowing root ssh", sub {
if (! -e $AUTHKEYS) {
CreateFileFatal($AUTHKEYS);
}
AppendToFileFatal($AUTHKEYS,
"from=\"${BOSSNODE}\" $ident");
# This does not work when ops is a vm on boss.
$ident = "from=\"${BOSSNODE}\" $ident"
if (!$OPSVM_ENABLE);
AppendToFileFatal($AUTHKEYS, $ident);
};
};
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2005, 2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use Getopt::Std;
......@@ -126,7 +126,19 @@ while (<IF>) {
}
}
elsif ($2 eq "fsnode_ina") {
if ($USERNODE_IP ne $FSNODE_IP) {
if ($USERNODE_IP eq $FSNODE_IP) {
$internal_strings .=
"fs\t\tIN\tCNAME\tops\n";
$external_strings .=
"fs\t\tIN\tCNAME\tops\n";
}
elsif ($BOSSNODE_IP eq $FSNODE_IP) {
$internal_strings .=
"fs\t\tIN\tCNAME\tboss\n";
$external_strings .=
"fs\t\tIN\tCNAME\tboss\n";
}
else {
#
# If name is not "fs", we need an A record for that
#
......@@ -140,11 +152,6 @@ while (<IF>) {
"${FSTOKEN}\t\tIN\tA\t\t${FSNODE_IP}\n";
$external_strings .=
"${FSTOKEN}\t\tIN\tA\t\t${EXTERNAL_FSNODE_IP}\n";
} else {
$internal_strings .=
"fs\t\tIN\tCNAME\tops\n";
$external_strings .=
"fs\t\tIN\tCNAME\tops\n";
}
}
elsif ($2 eq "fsnode_mx") {
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2007, 2011 University of Utah and the Flux Group.
# All rights reserved.
#
use Getopt::Std;
......@@ -90,7 +90,7 @@ for (my $i = $ic; $i <= $ic + (255 - $imc); $i++) {
if ($USERNODE_IP =~ /\d+\.\d+\.$i\.(\d+)/) {
print REV "${1}\tIN\tPTR\tops.${OURDOMAIN}.\n";
}
if ($FSNODE_IP ne $USERNODE_IP &&
if ($FSNODE_IP ne $USERNODE_IP && $FSNODE_IP ne $BOSSNODE_IP &&
$FSNODE_IP =~ /\d+\.\d+\.$i\.(\d+)/) {
print REV "${1}\tIN\tPTR\tfs.${OURDOMAIN}.\n";
}
......@@ -126,6 +126,7 @@ for (my $i = $ec; $i <= $ec + (255 - $emc); $i++) {
print REV "${1}\tIN\tPTR\tops.${OURDOMAIN}.\n";
}
if ($EXTERNAL_FSNODE_IP ne $EXTERNAL_USERNODE_IP &&
$EXTERNAL_FSNODE_IP ne $EXTERNAL_BOSSNODE_IP &&
$EXTERNAL_FSNODE_IP =~ /\d+\.\d+\.$i\.(\d+)/) {
print REV "${1}\tIN\tPTR\tfs.${OURDOMAIN}.\n";
}
......
......@@ -246,7 +246,7 @@ while (my ($node_id,$role) = $query_result->fetchrow_array()) {
$noderoles{$node_id} = $role;
$bossnode = $node_id
if ($role eq 'boss' || $role eq 'boss+router');
if ($role =~ /^boss/);
$routernode = $node_id
if ($role eq 'router');
$opsnode = $node_id
......@@ -304,12 +304,15 @@ my $mkextrafs = "";
if (-e "$TB/etc/mkextrafs.pl") {
$mkextrafs = "$TB/etc/mkextrafs.pl";
}
print "Copying $mkelab $mkextrafs to ${bossnode}/${opsnode}";
print "Copying $mkelab $mkextrafs to ${bossnode}";
print "/${opsnode}"
if (defined($opsnode));
print "/${fsnode}"
if (defined($fsnode));
print "\n";
system("scp $mkelab $mkextrafs ${bossnode}:/tmp");
system("scp $mkelab $mkextrafs ${opsnode}:/tmp");
system("scp $mkelab $mkextrafs ${opsnode}:/tmp")
if (defined($opsnode));
system("scp $mkelab $mkextrafs ${fsnode}:/tmp")
if (defined($fsnode));
......@@ -330,20 +333,22 @@ if (defined($fsnode)) {
exit(($debug ? 0 : -1));
}
}
TBDebugTimeStamp("Setting up opsnode");
print "Setting up opsnode on $opsnode\n";
system("$SSH -host $opsnode /tmp/rc.mkelab -s -d > $opslogfile 2>&1");
if ($?) {
$UID = $SAVEUID;
SENDMAIL("$user_name <$user_email>",
"ElabInElab Failure: $pid/$eid",
"Error building the ops node ($opsnode)",
$TBOPS,
"Cc: $TBOPS",
($opslogfile));
print STDERR "*** $0:\n".
" Error building the opsnode ($opsnode)!\n";
exit(($debug ? 0 : -1));
if (defined($opsnode)) {
TBDebugTimeStamp("Setting up opsnode");
print "Setting up opsnode on $opsnode\n";
system("$SSH -host $opsnode /tmp/rc.mkelab -s -d > $opslogfile 2>&1");
if ($?) {
$UID = $SAVEUID;
SENDMAIL("$user_name <$user_email>",
"ElabInElab Failure: $pid/$eid",
"Error building the ops node ($opsnode)",
$TBOPS,
"Cc: $TBOPS",
($opslogfile));
print STDERR "*** $0:\n".
" Error building the opsnode ($opsnode)!\n";
exit(($debug ? 0 : -1));
}
}
TBDebugTimeStamp("Setting up bossnode");
print "Setting up bossnode on $bossnode\n";
......@@ -404,7 +409,9 @@ if ($?) {
}
if ($inparallel) {
my $nodes = "$bossnode $opsnode";
my $nodes = "$bossnode";
$nodes .= " $opsnode"
if (defined($opsnode));
$nodes .= " $fsnode"
if (defined($fsnode));
print "Rebooting servers ($nodes).\n";
......@@ -425,13 +432,15 @@ if ($inparallel) {
" Error rebooting the fsnode ($fsnode)!\n");
}
}
# Reboot ops and wait for it to come back.
print "Rebooting opsnode ($opsnode).\n";
TBDebugTimeStamp("Rebooting opsnode");
system("$nodereboot -w $opsnode");
if ($?) {
die("*** $0:\n".
" Error rebooting the opsnode ($opsnode)!\n");
if (defined($opsnode)) {
# Reboot ops and wait for it to come back.
print "Rebooting opsnode ($opsnode).\n";
TBDebugTimeStamp("Rebooting opsnode");
system("$nodereboot -w $opsnode");
if ($?) {
die("*** $0:\n".
" Error rebooting the opsnode ($opsnode)!\n");
}
}
# Reboot boss and wait for it to come back.
print "Rebooting bossnode ($bossnode).\n";
......@@ -625,6 +634,34 @@ sub DumpDBGoo()
die("*** $0:\n".
" Could not chmod $statedir\n");
#
# No place else for this; when ops is a vm on boss, need to generate
# a proper IP that is routable on the control network.
#
my $attributes = $experiment->GetElabInElabAttrs();
die("*** $0:\n".
" Could not get elabinelab attributes\n")
if (!defined($attributes));
if (exists($attributes->{'CONFIG_OPSVM'}) && $attributes->{'CONFIG_OPSVM'}){
#
# Need to assign an IP to the ops node for the jail.
#
my $pnode = Node->Lookup($bossnode);
die("*** $0:\n".
" Could not lookup $bossnode\n")
if (!defined($pnode));
my $ip = $pnode->GetJailIP();
die("*** $0:\n".
" Could not generate an IP for OPS jail\n")
if (!defined($ip));
print "Setting the IP for OPS jail to $ip\n";
$experiment->SetElabInElabAttr("boss", "OPSIP", $ip);
$experiment->SetElabInElabAttr("ops", "OPSIP", $ip);
$experiment->SetElabInElabAttr("fs", "OPSIP", $ip);
}
#
# These tables are dumped completely.
#
......@@ -712,7 +749,8 @@ sub DumpDBGoo()
"where node_id='$fsnode'")
if (defined($fsnode));
DBQueryFatal("update temp_${table} set node_id='ops' ".
"where node_id='$opsnode'");
"where node_id='$opsnode'")
if (defined($opsnode));
if ($table eq "nodes") {
DBQueryFatal("update temp_${table} set ".
......@@ -950,10 +988,12 @@ sub DumpDBGoo()
or die("*** $0:\n".
" Could not fs node_id in temp_interfaces\n");
}
DBQueryWarn("update temp_interfaces set node_id='ops' ".
"where node_id='$opsnode'")
or die("*** $0:\n".
" Could not ops node_id in temp_interfaces\n");
if (defined($opsnode)) {
DBQueryWarn("update temp_interfaces set node_id='ops' ".
"where node_id='$opsnode'")
or die("*** $0:\n".
" Could not ops node_id in temp_interfaces\n");
}
# Also add the interfaces that correspond to the "trunk" wires.
DBQueryFatal("insert into temp_interfaces ".
......@@ -986,10 +1026,12 @@ sub DumpDBGoo()
or die("*** $0:\n".
" Could not fs node_id in temp_wires\n");
}
DBQueryWarn("update temp_wires set node_id1='ops' ".
"where node_id1='$opsnode'")
or die("*** $0:\n".
" Could not ops node_id in temp_wires\n");
if (defined($opsnode)) {
DBQueryWarn("update temp_wires set node_id1='ops' ".
"where node_id1='$opsnode'")
or die("*** $0:\n".
" Could not ops node_id in temp_wires\n");
}
if (! $elabinelab_singlenet) {
# But we need to take out the wires that are being used as the
......@@ -1037,14 +1079,16 @@ sub DumpDBGoo()
or die("*** $0:\n".
" Could not update temporary table temp_reserved\n");
}
DBQueryWarn("update temp_reserved set ".
" node_id='ops', ".
" pid='$TBOPSPID', ".
" eid='opsnodes', ".
" exptidx=1 ".
"where node_id='$opsnode'")
or die("*** $0:\n".
" Could not update temporary table temp_reserved\n");
if (defined($opsnode)) {
DBQueryWarn("update temp_reserved set ".
" node_id='ops', ".
" pid='$TBOPSPID', ".
" eid='opsnodes', ".
" exptidx=1 ".
"where node_id='$opsnode'")
or die("*** $0:\n".
" Could not update temporary table temp_reserved\n");
}
DBQueryWarn("select * from temp_reserved ".
"into outfile '$statedir/reserved'")
or die("*** $0:\n".
......@@ -1170,7 +1214,8 @@ sub TearDownEmulab()
" temp_boot_osid=NULL ".
"where " .
join(" or ", map("node_id='$_'",
($bossnode, $opsnode,
($bossnode,
defined($opsnode) ? $opsnode : (),
defined($fsnode) ? $fsnode : (),
@expnodes))));
......
......@@ -10,7 +10,7 @@
#
set myboss [$ns node]
tb-set-node-inner-elab-role $myboss boss+router
tb-set-node-inner-elab-role $myboss boss+fs+router
tb-set-elabinelab-attribute CONFIG_OPSVM 1
tb-set-elabinelab-attribute OPSNODE myops
......@@ -107,3 +107,4 @@ if {[info exists ::TBCOMPAT::elabinelab_nodeos("boss")]} {
} else {
tb-set-node-os $myboss FBSD73-STD
}
tb-set-node-loadlist $myboss FBSD73-S2
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