Commit efc63462 authored by Leigh Stoller's avatar Leigh Stoller

Restore OPSVM (ops in a jail) code and fix bitrot.

parent 59a99fcc
This diff is collapsed.
......@@ -54,6 +54,23 @@ sub Install($$$)
};
}
};
if ($OPSVM_ENABLE) {
# This only happens on boss.
Phase "symlinks", "Symlinking to OPS VM", sub {
Phase $OPSDIR_MOUNTPOINT, $OPSDIR_MOUNTPOINT, sub {
PhaseSkip("exists")
if (-e $OPSDIR_MOUNTPOINT && -l $OPSDIR_MOUNTPOINT);
ExecQuietFatal("ln -s ${OPSVM_MOUNTPOINT}/usr/testbed ".
"$OPSDIR_MOUNTPOINT");
};
Phase $USERSVAR_MOUNTPOINT, $USERSVAR_MOUNTPOINT, sub {
PhaseSkip("exists")
if (-e $USERSVAR_MOUNTPOINT && -l $USERSVAR_MOUNTPOINT);
ExecQuietFatal("ln -s ${OPSVM_MOUNTPOINT}/var ".
"$USERSVAR_MOUNTPOINT");
};
};
}
return 0;
}
......
......@@ -108,23 +108,6 @@ sub Install($$$)
};
}
};
if ($OPSVM_ENABLE) {
# This only happens on boss.
Phase "symlinks", "Symlinking to OPS VM", sub {
Phase $OPSDIR_MOUNTPOINT, $OPSDIR_MOUNTPOINT, sub {
PhaseSkip("exists")
if (-e $OPSDIR_MOUNTPOINT && -l $OPSDIR_MOUNTPOINT);
ExecQuietFatal("ln -s ${OPSVM_MOUNTPOINT}/usr/testbed ".
"$OPSDIR_MOUNTPOINT");
};
Phase $USERSVAR_MOUNTPOINT, $USERSVAR_MOUNTPOINT, sub {
PhaseSkip("exists")
if (-e $USERSVAR_MOUNTPOINT && -l $USERSVAR_MOUNTPOINT);
ExecQuietFatal("ln -s ${OPSVM_MOUNTPOINT}/var ".
"$USERSVAR_MOUNTPOINT");
};
};
}
};
return 0;
}
......
#
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
# Copyright (c) 2000-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -35,6 +35,7 @@ LIB_STUFF = lanlink.tcl node.tcl sim.tcl tb_compat.tcl null.tcl \
nsobject.tcl traffic.tcl vtype.tcl parse.tcl program.tcl \
nsenode.tcl nstb_compat.tcl event.tcl firewall.tcl \
elabinelab.ns elabinelab-withfsnode.ns \
elabinelab-opsvm.ns elabinelab-xenopsvm.ns \
fw.ns timeline.tcl sequence.tcl \
topography.tcl console.tcl path.tcl \
disk.tcl custom.tcl elabinelab-xen.ns \
......
#
# Copyright (c) 2004-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
#
# This file is intended to be included into another NS file. It is not
# a stand alone file.
#
set myboss [$ns node]
tb-set-node-inner-elab-role $myboss boss+fs+router
tb-set-elabinelab-attribute CONFIG_OPSVM 1
tb-set-elabinelab-attribute OPSNODE myops
set srvtype pcvm
set nodetype pcslow
tb-set-node-failure-action $myboss "nonfatal"
if {[info exists ::TBCOMPAT::elabinelab_hardware("boss")]} {
namespace eval TBCOMPAT {
tb-set-hardware $myboss $elabinelab_hardware("boss")
}
} else {
tb-set-hardware $myboss $srvtype
}
if {[info exists ::TBCOMPAT::elabinelab_fixnodes("boss")]} {
namespace eval TBCOMPAT {
tb-fix-node $myboss $elabinelab_fixnodes("boss")
}
}
# Deal with tarfiles
set myboss_tarfiles ""
if {${::TBCOMPAT::elabinelab_source_tarfile} != ""} {
append myboss_tarfiles "/usr/src ${::TBCOMPAT::elabinelab_source_tarfile}"
}
if {[info exists ::TBCOMPAT::elabinelab_tarfiles("boss")]} {
if {$myboss_tarfiles != ""} {
append myboss_tarfiles " "
}
namespace eval TBCOMPAT {
append myboss_tarfiles $elabinelab_tarfiles("boss")
}
}
if {$myboss_tarfiles != ""} {
tb-set-node-tarfiles $myboss $myboss_tarfiles
}
#
# This is passed in by the parser, when wrapping an existing experiment.
# The parser wrapper gets info about the wrapped experiment and passes it
# along in the TBCOMPAT namespace.
#
if { ${::TBCOMPAT::elabinelab_maxpcs} != 0 } {
set maxpcs ${::TBCOMPAT::elabinelab_maxpcs}
} else {
set maxpcs 0
}
set lanstr "myboss "
for {set i 1} {$i <= $maxpcs} {incr i} {
set name "mypc${i}"
set $name [$ns node]
append lanstr "[set $name] "
tb-set-node-inner-elab-role [set $name] node
if {[info exists ::TBCOMPAT::elabinelab_nodeos($name)]} {
namespace eval TBCOMPAT {
tb-set-node-os [set $name] $elabinelab_nodeos($name)
}
}
#
# This does not work! I have no idea why, I hate TCL!
#
if {[info exists ::TBCOMPAT::elabinelab_fixnodes($name)]} {
namespace eval TBCOMPAT {
tb-fix-node [set $name] $elabinelab_fixnodes($name)
}
} elseif {[info exists ::TBCOMPAT::elabinelab_hardware($name)]} {
namespace eval TBCOMPAT {
tb-set-hardware [set $name] $elabinelab_hardware($name)
}
} else {
tb-set-hardware [set $name] $nodetype
}
}
if { ${::GLOBALS::elabinelab_singlenet} == 0 } {
set publiclan [$ns make-lan $lanstr 100Mb 0ms]
tb-set-ip-lan $myboss $publiclan 10.200.1.252
for {set i 1} {$i <= $maxpcs} {incr i} {
set name "mypc${i}"
tb-set-ip-lan [set $name] $publiclan 10.200.1.$i
}
}
if {[info exists ::TBCOMPAT::elabinelab_nodeos("boss")]} {
namespace eval TBCOMPAT {
tb-set-node-os $myboss $elabinelab_nodeos("boss")
}
} else {
tb-set-node-os $myboss FBSD111-64-STD
}
tb-set-node-loadlist $myboss FBSD111-64-S2
#
# Tell ElabinElab setup (rc.mkelab) as well.
#
# XXX The use of specific devices like da2 is not the best approach.
# Note that the FreeBSD guest starts with the root disk on da0,
# so we start at da2 ...
# XXX Really bad idea because now FreeBSD VMs use "ada" rather than "da"
# (because we use "hd" rather than "sd" in the xm.conf file..long story)
#
#tb-set-elabinelab-role-attribute "boss" "EXTRADISKS" "ada1:/usr/testbed,ada2:/usr/testbed/data,ada3:/usr/testbed/log"
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