DeterVirtualProject: multi_euca_cloud.ns

File multi_euca_cloud.ns, 4.5 KB (added by liyin, 9 years ago)

The example ns script to install multiple eucalyptus cloud in one experiment

Line 
1#--------------------------------------
2# This experiment consists of 3 clouds with 5 nodes as resources.
3# Firth cloud roles as a set of brokers that runs benchmark applications such as webstone
4#--------------------------------------
5
6set ns [new Simulator]
7source tb_compat.tcl
8
9tb-set-delay-capacity 1
10
11#--------------------------------------
12# First Cloud
13# Resource type 2 (bpc2133) : Xeon CPU, 4096 memory
14#--------------------------------------
15
16set node11 [$ns node]
17tb-set-node-os $node11 Ubuntu-Xen-904
18tb-set-hardware $node11 pc3000
19
20set node12 [$ns node]
21tb-set-node-os $node12 Ubuntu-Xen-904
22tb-set-hardware $node12 pc3000
23
24set node13 [$ns node]
25tb-set-node-os $node13 Ubuntu-Xen-904
26tb-set-hardware $node13 pc3000
27
28
29set ctl1 [$ns node]
30tb-set-node-os $ctl1  Ubuntu904-unsup
31tb-set-hardware $ctl1 pc3000
32
33set cli1 [$ns node]
34tb-set-node-os $cli1  Ubuntu904-unsup
35tb-set-hardware $cli1 pc3000
36
37set lan1 [$ns make-lan "$ctl1 $node11 $node12 $node13 $cli1" 1000Mb 0ms]
38$ns rtproto Static
39
40tb-set-sync-server $ctl1
41tb-set-node-startcmd $ctl1 "bash /proj/Virtual/script/eucalyptus_setup/install_ctl.sh node11 node12 node13 >& /tmp/ctl1.log"
42tb-set-node-startcmd $node11 "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node11.log"
43tb-set-node-startcmd $node12 "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node12.log"
44tb-set-node-startcmd $node13 "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node13.log"
45tb-set-node-startcmd $cli1 "bash /proj/Virtual/script/eucalyptus_setup/install_cli.sh >& /tmp/cli1.log"
46
47#--------------------------------------
48# Second Cloud
49# Resource type 3 (pc3000) : Dual Xeon, 2048 memory
50#--------------------------------------
51
52set node21 [$ns node]
53tb-set-node-os $node21 Ubuntu-Xen-904
54tb-set-hardware $node21 pc3000
55
56set node22 [$ns node]
57tb-set-node-os $node22 Ubuntu-Xen-904
58tb-set-hardware $node22 pc3000
59
60set node23 [$ns node]
61tb-set-node-os $node23 Ubuntu-Xen-904
62tb-set-hardware $node23 pc3000
63
64
65set ctl2 [$ns node]
66tb-set-node-os $ctl2  Ubuntu904-unsup
67tb-set-hardware $ctl2 pc3000
68
69set cli2 [$ns node]
70tb-set-node-os $cli2  Ubuntu904-unsup
71tb-set-hardware $cli2 pc3000
72
73set lan2 [$ns make-lan "$ctl2 $node21 $node22 $node23  $cli2" 1000Mb 0ms]
74$ns rtproto Static
75
76tb-set-sync-server $ctl2
77tb-set-node-startcmd $ctl2 "bash /proj/Virtual/script/eucalyptus_setup/install_ctl.sh node21 node22 node23 >& /tmp/ctl2.log"
78tb-set-node-startcmd $node21 "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node21.log"
79tb-set-node-startcmd $node22 "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node22.log"
80tb-set-node-startcmd $node23 "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node23.log"
81
82tb-set-node-startcmd $cli2 "bash /proj/Virtual/script/eucalyptus_setup/install_cli.sh >& /tmp/cli2.log"
83
84#--------------------------------------
85# Fourth Cloud - Brokers
86# Resource type 3 (pc3060) : Dual Xeon CPU, 2048 memory
87#--------------------------------------
88
89set node41b [$ns node]
90tb-set-node-os $node41b Ubuntu-Xen-904
91tb-set-hardware $node41b pc3000
92
93set node42b [$ns node]
94tb-set-node-os $node42b Ubuntu-Xen-904
95tb-set-hardware $node42b pc3000
96
97set node43b [$ns node]
98tb-set-node-os $node43b Ubuntu-Xen-904
99tb-set-hardware $node43b pc3000
100
101set ctl4b [$ns node]
102tb-set-node-os $ctl4b  Ubuntu904-unsup
103tb-set-hardware $ctl4b pc3000
104
105set cli4b [$ns node]
106tb-set-node-os $cli4b  Ubuntu904-unsup
107tb-set-hardware $cli4b pc3000
108
109set lan4b [$ns make-lan "$ctl4b $node41b $node42b $node43b $cli4b" 1000Mb 0ms]
110$ns rtproto Static
111
112tb-set-sync-server $ctl4b
113tb-set-node-startcmd $ctl4b "bash /proj/Virtual/script/eucalyptus_setup/install_ctl.sh node41b node42b node43b >& /tmp/ctl4b.log"
114tb-set-node-startcmd $node41b "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node41b.log"
115tb-set-node-startcmd $node42b "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node42b.log"
116tb-set-node-startcmd $node43b "bash /proj/Virtual/script/eucalyptus_setup/install_node.sh >& /tmp/node43b.log"
117tb-set-node-startcmd $cli4b "bash /proj/Virtual/script/eucalyptus_setup/install_cli.sh >& /tmp/cli4b.log"
118
119
120#========================================
121# controller
122#========================================
123
124set controller [$ns node]
125tb-set-node-os $controller  Ubuntu904-unsup
126set mainlan [$ns make-lan "$cli1 $cli2 $cli4b $controller" 1000Mb 0ms]
127$ns rtproto Static
128
129
130$ns run
131