-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflowvisor_scenario.xml
170 lines (139 loc) · 5.15 KB
/
flowvisor_scenario.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?xml version="1.0" encoding="UTF-8"?>
<!--
~~~~~~~~~~~~~~~~~~~~~~
VNX Sample scenarios
~~~~~~~~~~~~~~~~~~~~~~
Name: flowvisor_scenario
Description:
Author: Ignacio Gomez Saez and Carlos Vega Garcia
-->
<vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-2.00.xsd">
<global>
<version>2.0</version>
<scenario_name>flowvisor_scenario</scenario_name>
<automac/>
<vm_mgmt type="none" />
<vm_defaults>
<console id="0" display="no"/>
<console id="1" display="yes"/>
</vm_defaults>
</global>
<net name="s1" mode="openvswitch" hwaddr="00:00:00:00:00:01" controller='tcp:127.0.0.1:6633' of_version="OpenFlow10" fail_mode='secure'>
<connection name='s1-s2' net='s2'/>
<connection name='s1-s3' net='s3'/>
</net>
<net name="s2" mode="openvswitch" hwaddr="00:00:00:00:00:02" controller='tcp:127.0.0.1:6633' of_version="OpenFlow10" fail_mode='secure'>
<connection name='s2-s4' net='s4'/>
</net>
<net name="s3" mode="openvswitch" hwaddr="00:00:00:00:00:03" controller='tcp:127.0.0.1:6633' of_version="OpenFlow10" fail_mode='secure'>
<connection name='s3-s4' net='s4'/>
</net>
<net name="s4" mode="openvswitch" hwaddr="00:00:00:00:00:04" controller='tcp:127.0.0.1:6633' of_version="OpenFlow10" fail_mode='secure'>
</net>
<vm name="h1" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="s1">
<mac>00:00:00:00:00:01</mac>
<ipv4>10.0.0.1/24</ipv4>
</if>
<!-- Copy /etc/hosts file -->
<filetree seq="on_boot" root="/tmp/">conf/hosts</filetree>
<exec seq="on_boot" type="verbatim">
cat /tmp/hosts >> /etc/hosts
rm /tmp/hosts
</exec>
</vm>
<vm name="h2" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="s1">
<mac>00:00:00:00:00:02</mac>
<ipv4>10.0.0.2/24</ipv4>
</if>
<!-- Copy /etc/hosts file -->
<filetree seq="on_boot" root="/tmp/">conf/hosts</filetree>
<exec seq="on_boot" type="verbatim">
cat /tmp/hosts >> /etc/hosts
rm /tmp/hosts
</exec>
</vm>
<vm name="h3" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="s4">
<mac>00:00:00:00:00:03</mac>
<ipv4>10.0.0.3/24</ipv4>
</if>
<!-- Copy /etc/hosts file -->
<filetree seq="on_boot" root="/tmp/">conf/hosts</filetree>
<exec seq="on_boot" type="verbatim">
cat /tmp/hosts >> /etc/hosts
rm /tmp/hosts
</exec>
</vm>
<vm name="h4" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="s4">
<mac>00:00:00:00:00:04</mac>
<ipv4>10.0.0.4/24</ipv4>
</if>
<!-- Copy /etc/hosts file -->
<filetree seq="on_boot" root="/tmp/">conf/hosts</filetree>
<exec seq="on_boot" type="verbatim">
cat /tmp/hosts >> /etc/hosts
rm /tmp/hosts
</exec>
</vm>
<host>
<!-- Permissions and limitations-->
<exec seq="on_boot" type="verbatim">
chmod +x ./*.py ./*.sh
sudo easy_install pip
wget https://github.com/thombashi/tcconfig/releases/download/v0.17.0/tcconfig_wheel.tar.gz
tar xvf tcconfig_wheel.tar.gz
cd tcconfig_wheel/
sudo ./install.sh
sudo tcset --device s1-s2-0 --rate 1M
sudo tcset --device s1-s2-1 --rate 1M
tcshow --device s1-s2-0
tcshow --device s1-s2-1
sudo tcset --device s2-s4-0 --rate 1M
sudo tcset --device s2-s4-1 --rate 1M
tcshow --device s2-s4-0
tcshow --device s2-s4-1
sudo tcset --device s1-s3-0 --rate 10M
sudo tcset --device s1-s3-1 --rate 10M
tcshow --device s1-s3-0
tcshow --device s1-s3-1
sudo tcset --device s3-s4-0 --rate 10M
sudo tcset --device s3-s4-1 --rate 10M
tcshow --device s3-s4-0
tcshow --device s3-s4-1
</exec>
<exec seq="start-all-scenario1" type="verbatim" ostype="system">
/etc/init.d/flowvisor stop
/etc/init.d/flowvisor restart
sleep 4
xterm -title "Creating slices and add-flows" -e "python ./create_slices_and_add_flows_scenario1.py" &
./start_controllers.sh
</exec>
<exec seq="start-all-scenario2" type="verbatim" ostype="system">
/etc/init.d/flowvisor stop
/etc/init.d/flowvisor restart
sleep 4
xterm -title "Creating slices and add-flows" -e "python ./create_slices_and_add_flows_scenario2.py" &
./start_controllers.sh
</exec>
<exec seq="destroy-all-scenario1" type="verbatim" ostype="system">
fvctl -f /dev/null remove-slice upper
fvctl -f /dev/null remove-slice lower
/etc/init.d/flowvisor stop
pkill -9 -f pox.py
</exec>
<exec seq="destroy-all-scenario2" type="verbatim" ostype="system">
fvctl -f /dev/null remove-slice video
fvctl -f /dev/null remove-slice non-video
/etc/init.d/flowvisor stop
pkill -9 -f pox.py
</exec>
</host>
</vnx>