UsersGuide: example5.tcl

File example5.tcl, 686 bytes (added by Ted Faber, 12 years ago)

Example of setting openvz parameters

Line 
1source tb_compat.tcl
2set ns [new Simulator]
3
4# Create the center node (named by its variable name)
5set center [$ns node]
6# The center node is a process
7tb-add-node-attribute $center containers:node_type process
8tb-add-node-attribute $center containers:openvz_template ubuntu-12.04-x86_64
9
10# Connect 9 satellites
11for { set i 0} { $i < 9 } { incr i} {
12    # Create node n-1 (tcl n($i) becomes n-$i in the experiment)
13    set n($i) [$ns node]
14    # Set satellite disk sizes to be 20 GB
15    tb-add-node-attribute $n($i) containers:openvz_diskspace 20G
16    # Connect center to $n($i)
17    ns duplex-link $center $n($i) 100Mb 10ms DropTail
18}
19
20# Creation boilerplate
21$ns rtptoto Static
22$ns run