Commit 75a48286 authored by Leigh Stoller's avatar Leigh Stoller

Add new elabinelab topo called opsvm, which causes ops to be a VM

(jail) on boss. A typical NS file might look like this, although note
that windows support is not finished yet. 

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 97923a9c
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -17,7 +17,7 @@ include $(OBJDIR)/Makeconf
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.ns elabinelab-withfsnode.ns elabinelab-opsvm.ns \
fw.ns timeline.tcl sequence.tcl \
topography.tcl console.tcl path.tcl
BOSSLIBEXEC = parse-ns
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004-2011 University of Utah and the Flux Group.
# All rights reserved.
#
#
# 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+router
tb-set-elabinelab-attribute CONFIG_OPSVM 1
tb-set-elabinelab-attribute OPSNODE myops
if {[info exists ::TBCOMPAT::elabinelab_hardware("boss")]} {
namespace eval TBCOMPAT {
tb-set-hardware $myboss $elabinelab_hardware("boss")
}
} else {
tb-set-hardware $myboss pc850
}
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
}
tb-make-soft-vtype pcslow {pc600 pc850}
#
# 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)
}
}
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] pcslow
}
}
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")
}
} elseif {[info exists ::TBCOMPAT::sitevariables(elabinelab/boss_osid)]} {
namespace eval TBCOMPAT {
tb-set-node-os $myboss $sitevariables(elabinelab/boss_osid)
}
} else {
tb-set-node-os $myboss FBSD73-STD
}
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