Merge "Added overview of Controller to developers guide."
[docs.git] / manuals / user-guide / src / main / asciidoc / vtn / VTN_OpenStack_Support-user.adoc
1 === VTN OpenStack Configuration
2
3 This guide describes how to set up OpenStack for integration with OpenDaylight Controller.
4
5 While OpenDaylight Controller provides several ways to integrate with OpenStack, this guide focus on the way which uses VTN features available on OpenDaylight controller.In the integration, VTN Manager work as network service provider for OpenStack.
6
7 VTN Manager features, enable OpenStack to work in pure OpenFlow environment in which all switches in data plane are OpenFlow switch.
8
9 ==== Requirements
10 To use OpenDaylight Controller (ODL) as Network Service Provider for Openstack.
11
12 ==== Components
13 * OpenDaylight Controller.
14 * OpenStack Control Node.
15 * OpenStack Compute Node.
16 * OpenFlow Switch like mininet(Not Mandatory).
17
18 The VTN features support multiple OpenStack nodes. You can deploy multiple OpenStack Compute Nodes.
19 In management plane, OpenDaylight Controller, OpenStack nodes and OpenFlow switches should communicate with each other.
20 In data plane, Open vSwitches running in OpenStack nodes should communicate with each other through a physical or logical OpenFlow switches. The core OpenFlow switches are not mandatory. Therefore, you can directly connect to the Open vSwitch's.
21
22 .LAB Setup
23 image::vtn/vtn_devstack_setup.png["LAB Setup" ,width= 500]
24 NOTE: Ubuntu 14.04 was used in both the nodes and Vsphere was used for this howto.
25
26 ==== Configuration
27
28 *Server Preparation*
29 [horizontal]
30 - Install Ubuntu 14.04 LTS in two servers (OpenStack Control node and Compute node respectively)
31 - While installing, Ubuntu mandates creation of a User, we created the user "stack"(We will use the same user for running devstack)
32 NOTE: You can also have multiple Compute nodes.
33 TIP: Please do minimal Install to avoid any issues in devstack bringup
34
35 *User Settings*
36 - Login to both servers
37 - Disable Ubuntu Firewall
38
39
40   sudo ufw disable
41
42 - Optionally install these packages
43
44
45   sudo apt-get install net-tools
46
47 - Edit sudo vim /etc/sudoers and add an entry as follows
48
49
50   stack ALL=(ALL) NOPASSWD: ALL
51
52 *Network Settings*
53 - Checked the output of ifconfig -a, two interfaces were listed eth0 and eth1 as indicated in the image above.
54 - We had connected eth0 interface to the Network where ODL Controller is reachable.
55 - eth1 interface in both servers were connected to a different network to act as data plane for the VM's created using the OpenStack.
56 - Manually edited the file : sudo vim /etc/network/interfaces and made entries as follows
57
58
59    stack@ubuntu-devstack:~/devstack$ cat /etc/network/interfaces
60    # This file describes the network interfaces available on your system
61    # and how to activate them. For more information, see interfaces(5).
62    # The loop-back network interface
63    auto lo
64    iface lo inet loopback
65    # The primary network interface
66    auto eth0
67    iface eth0 inet static
68         address <IP_ADDRESS_TO_REACH_ODL>
69         netmask <NET_MASK>
70         broadcast <BROADCAST_IP_ADDRESS>
71         gateway <GATEWAY_IP_ADDRESS>
72   auto eth1
73   iface eth1 inet static
74        address <IP_ADDRESS_UNIQ>
75        netmask <NETMASK>
76
77 NOTE: Please ensure that the eth0 interface is the default route and it is able to reach the ODL_IP_ADDRESS
78 NOTE: The entries for eth1 are not mandatory, If not set, we may have to manually do "ifup eth1" after the stacking is complete to activate the interface
79
80 *Finalize*
81 - reboot both nodes after the user and network settings to have the network settings applied to the network
82 - Login again and check the output of ifconfig to ensure that both interfaces are listed
83
84 ====  ODL Settings and Execution
85 =====  vtn.ini
86  * VTN uses the configuration parameters from  'vtn.ini' file for the OpenStack integration.
87  * These values will be set for the OpenvSwitch, in all the participating OpenStack nodes.
88  * A configuration file 'vtn.ini'''' needs to be created manually in the 'configuration' directory.
89  * The contents of 'vtn.ini' should be as follows:
90
91
92 bridgename=br-int
93 portname=eth1
94 protocols=OpenFlow13
95 failmode=secure
96
97  * The values of the configuration parameters must be changed based on the user environment.
98  * Especially, "portname" should be carefully configured, because if the value is wrong, OpenDaylight controller fails to forward packets.
99  * Other parameters works fine as is for general use cases.
100  ** bridgename
101  *** The name of the bridge in Open vSwitch, that will be created by OpenDaylight Controller.
102  *** It must be "br-int".
103  ** portname
104  *** The name of the port that will be created in the vbridge in Open vSwitch.
105  *** This must be the same name of the interface of OpenStack Nodes which is used for interconnecting OpenStack Nodes in data plane.(in our case:eth1)
106  *** By default, if vtn.ini is not created, VTN uses ens33 as portname.
107  ** protocols
108  *** OpenFlow protocol through which OpenFlow Switch and Controller communicate.
109  *** The values can be OpenFlow13 or OpenFlow10.
110  ** failmode
111  *** The value can be "standalone" or "secure".
112  *** Please use "secure" for general use cases.
113
114 ====  Start ODL Controller
115
116  * Please install the feature *odl-vtn-manager-neutron* that provides the integration with Neutron interface.
117
118   install odl-vtn-manager-neutron
119
120 TIP: After running ODL Controller, please ensure ODL Controller listens to the ports:6633,6653, 6640 and 8080
121
122 TIP: Please allow the ports in firewall for the devstack to be able to communicate with ODL Controller.
123
124 NOTE: 6633/6653 - OpenFlow Ports
125
126 NOTE: 6640 - OVS Manager Port
127
128 NOTE: 8282 - Port for REST API
129
130 ====  Devstack Setup
131
132 ===== VTN Devstack Script
133 * The local.conf is a user-maintained settings file. This allows all custom settings for DevStack to be contained in a single file. This file is processed strictly in sequence.
134 The following datas are needed to be set in the local.conf file:
135 * Set the Host_IP as the detection is unreliable.
136 * Set FLOATING_RANGE to a range not used on the local network, i.e. 192.168.1.224/27. This configures IP addresses ending in 225-254 to be used as floating IPs.
137 * Set FLAT_INTERFACE to the Ethernet interface that connects the host to your local network. This is the interface that should be configured with the static IP address mentioned above.
138 * If the *_PASSWORD variables are not set, we will be prompted to enter values during the execution of stack.sh.
139 * Set ADMIN_PASSWORD . This password is used for the admin and demo accounts set up as OpenStack users. We can login to the OpenStack GUI with this credentials only.
140 * Set the MYSQL_PASSWORD. The default here is a random hex string which is inconvenient if you need to look at the database directly for anything.
141 * Set the RABBIT_PASSWORD. This is used by messaging services used by both the nodes.
142 * Set the service password. This is used by the OpenStack services (Nova, Glance, etc) to authenticate with Keystone.
143
144 ====== DevStack Control
145 local.conf(control)
146 [source]
147 #IP Details
148 HOST_IP=<CONTROL_NODE_MANAGEMENT_IF_IP_ADDRESS>#Please Add The Control Node IP Address in this line
149 FLAT_INTERFACE=<FLAT_INTERFACE_NAME>
150 SERVICE_HOST=$HOST_IP
151 #Instance Details
152 MULTI_HOST=1
153 #config Details
154 RECLONE=yes #Make it "no" after stacking successfully the first time
155 VERBOSE=True
156 LOG_COLOR=True
157 LOGFILE=/opt/stack/logs/stack.sh.log
158 SCREEN_LOGDIR=/opt/stack/logs
159 #OFFLINE=True #Uncomment this after stacking successfully the first time
160 #Passwords
161 ADMIN_PASSWORD=labstack
162 MYSQL_PASSWORD=supersecret
163 RABBIT_PASSWORD=supersecret
164 SERVICE_PASSWORD=supersecret
165 SERVICE_TOKEN=supersecrettoken
166 ENABLE_TENANT_TUNNELS=false
167 #Services
168 disable_service rabbit
169 enable_service qpid
170 enable_service quantum
171 enable_service n-cpu
172 enable_service n-cond
173 disable_service n-net
174 enable_service q-svc
175 enable_service q-dhcp
176 enable_service q-meta
177 enable_service horizon
178 enable_service quantum
179 enable_service tempest
180 ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth,n-cauth,nova
181 ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
182 #ML2 Details
183 Q_PLUGIN=ml2
184 Q_ML2_PLUGIN_MECHANISM_DRIVERS=opendaylight
185 Q_ML2_TENANT_NETWORK_TYPE=local
186 Q_ML2_PLUGIN_TYPE_DRIVERS=local
187 disable_service n-net
188 enable_service q-svc
189 enable_service q-dhcp
190 enable_service q-meta
191 enable_service neutron
192 enable_service odl-compute
193 ODL_MGR_IP=<ODL_IP_ADDRESS> #Please Add the ODL IP Address in this line
194 OVS_PHYSICAL_BRIDGE=br-int
195 Q_OVS_USE_VETH=True
196 url=http://<ODL_IP_ADDRESS>:8080/controller/nb/v2/neutron #Please Add the ODL IP Address in this line
197 username=admin
198 password=admin
199
200 ====== DevStack Compute
201 local.conf(compute)
202 [source]
203 #IP Details
204 HOST_IP=<COMPUTE_NODE_MANAGEMENT_IP_ADDRESS> #Add the Compute node Management IP Address
205 SERVICE_HOST=<CONTROLLEr_NODE_MANAGEMENT_IP_ADDRESS> #Add the cotnrol Node Management IP Address here
206 #Instance Details
207 MULTI_HOST=1
208 #config Details
209 RECLONE=yes #Make thgis "no" after stacking successfully once
210 #OFFLINE=True #Uncomment this line after stacking successfuly first time.
211 VERBOSE=True
212 LOG_COLOR=True
213 LOGFILE=/opt/stack/logs/stack.sh.log
214 SCREEN_LOGDIR=/opt/stack/logs
215 #Passwords
216 ADMIN_PASSWORD=labstack
217 MYSQL_PASSWORD=supersecret
218 RABBIT_PASSWORD=supersecret
219 SERVICE_PASSWORD=supersecret
220 SERVICE_TOKEN=supersecrettoken
221 #Services
222 ENABLED_SERVICES=n-cpu,rabbit,neutron
223 #ML2 Details
224 Q_PLUGIN=ml2
225 Q_ML2_PLUGIN_MECHANISM_DRIVERS=opendaylight
226 Q_ML2_TENANT_NETWORK_TYPE=local
227 Q_ML2_PLUGIN_TYPE_DRIVERS=local
228 enable_service odl-compute
229 ODL_MGR_IP=<ODL_IP_ADDRESS> #ADD ODL IP address here
230 OVS_PHYSICAL_BRIDGE=br-int
231 ENABLE_TENANT_TUNNELS=false
232 Q_OVS_USE_VETH=True
233 #Details of the Control node for various services
234 [[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
235 Q_HOST=$SERVICE_HOST
236 MYSQL_HOST=$SERVICE_HOST
237 RABBIT_HOST=$SERVICE_HOST
238 GLANCE_HOSTPORT=$SERVICE_HOST:9292
239 KEYSTONE_AUTH_HOST=$SERVICE_HOST
240 KEYSTONE_SERVICE_HOST=$SERVICE_HOST
241 NOVA_VNC_ENABLED=True
242 NOVNCPROXY_URL="http://<CONTROLLER_NODE_IP_ADDRESS>:6080/vnc_auto.html" #Add Controller Node IP address
243 VNCSERVER_LISTEN=$HOST_IP
244 VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN
245
246 NOTE:
247    We have to comment OFFLINE=TRUE in local.conf files, this will make all the installations to happen automatically.
248    RECLONE=yes only when we set up the DevStack environment from scratch.
249
250 =====  Get Devstack (All nodes)
251 Install git application using
252
253
254 sudo apt-get install git
255 get devstack
256 git clone https://git.openstack.org/openstack-dev/devstack;
257
258 Switch to stable/Juno Version branch
259
260
261 cd devstack
262 git checkout stable/juno
263
264 ===== Stack Control Node
265
266 .local.conf: <<_devstack_control,DevStack Control>>
267
268   cd devstack in the controller node
269
270 * Copy the contents of local.conf (devstack control node)  and save it as "local.conf" in the devstack.
271 * Please modify the IP Address values as required.
272 * Stack the node
273
274   ./stack.sh
275
276 ====== Verify Control Node stacking
277 * stack.sh prints out Horizon is now available at http://<CONTROL_NODE_IP_ADDRESS>:8080/
278 * Execute the command 'sudo ovs-vsctl show' in the control node terminal and verify if the bridge 'br-int'  is created.
279
280 ===== Stack Compute Node
281
282 .local.conf: <<_devstack_compute,DevStack Compute>>
283
284   cd devstack in the controller node
285
286 * Copy the contents of local.conf (devstack compute node)  and save it as local.conf in the 'devstack'''.
287 * Please modify the IP Address values as required.
288 * Stack the node
289
290
291   ./stack.sh
292
293 ====== Verify Compute Node Stacking
294 * stack.sh prints out This is your host ip: <COMPUTE_NODE_IP_ADDRESS>
295 * Execute the command 'sudo ovs-vsctl show' in the control node terminal and verify if the bridge 'br-int'  is created.
296 * The output of the ovs-vsctl show will be similar to the one seen in control node.
297 ===== Additional Verifications
298 * Please visit the ODL DLUX GUI after stacking all the nodes, http://<ODL_IP_ADDRESS>:8181/dlux/index.html. The switches, topology and the ports that are currently read can be validated.
299
300 TIP: If the interconnected between the OVS is not seen, Please bring up the interface for the dataplane manually using the below comamnd
301
302
303   ifup <interface_name>
304
305 TIP: Some versions of OVS, drop packets when there is a table-miss, So please add the below flow to all the nodes with OVS version (>=2.1)
306
307
308   ovs-ofctl --protocols=OpenFlow13 add-flow br-int priority=0,actions=output:CONTROLLER
309
310 TIP: Please Accept Promiscuous mode in the networks involving the interconnect.
311
312 ===== Create VM from Devstack Horizon GUI
313 * Login to http://<CONTROL_NODE_IP>:8080/ to check the horizon GUI.
314
315 .Horizon GUI
316 image::vtn/OpenStackGui.png["Horizon",width= 600]
317
318 Enter the value for User Name as admin and enter the value for Password as labstack.
319
320 * We should first ensure both the hypervisors(control node and compute node) are mapped under hypervisors by clicking on Hpervisors tab.
321
322 .Hypervisors
323 image::vtn/Hypervisors.png["Hypervisors",width=512]
324
325 * Create a new Network from Horizon GUI.
326 * Click on Networks Tab.
327 * click on the Create Network button.
328
329 .Create Network
330 image::vtn/Create_Network.png["Create Network" ,width=600]
331
332 *  A popup screen will appear.
333 *  Enter network name and click Next button.
334
335 .Step 1
336 image::vtn/Creare_Network_Step_1.png["Step 1" ,width=600]
337 * Create a sub network by giving Network Address and click Next button .
338
339 .Step 2
340 image::vtn/Create_Network_Step_2.png[Step 2,width=600]
341
342 * Specify the additional details for subnetwork (please refer the image for your reference).
343
344 .Step 3
345 image::vtn/Create_Network_Step_3.png[Step 3,width=600]
346
347 * Click Create button
348 * Create VM Instance
349 * Navigate to Instances tab in the GUI.
350
351 .Instance Creation
352 image::vtn/Instance_Creation.png["Instance Creation",width=512]
353
354 * Click on Launch Instances button.
355
356 .Launch Instance
357 image::vtn/Launch_Instance.png[Launch Instance,width=600]
358
359 * Click on Details tab to enter the VM details.For this demo we are creating Ten VM's(instances).
360
361 * In the Networking tab, we must select the network,for this we need to drag and drop the Available networks to Selected Networks (i.e.,) Drag vtn1 we created from Available networks to Selected Networks and click Launch to create the instances.
362
363 .Launch Network
364 image::vtn/Launch_Instance_network.png[Launch Network,width=600]
365
366 * Ten VM's will be created.
367
368 .Load All Instances
369 image::vtn/Load_All_Instances.png[Load All Instances,width=600]
370
371 * Click on any VM displayed in the Instances tab and click the Console tab.
372
373 .Instance Console
374 image::vtn/Instance_Console.png[Instance Console,width=600]
375
376 * Login to the VM console and verify with a ping command.
377
378 .Ping
379 image::vtn/Instance_ping.png[Ping,width=600]
380
381
382 ===== Verification of Control and Compute Node after VM creation
383 The output of sudo ovs-vsctl command after VM creation
384 [source]
385   [stack@icehouse-compute-odl devstack]$ sudo ovs-vsctl show  Manager "tcp:192.168.64.73:6640"
386   is_connected: true
387   Bridge br-int
388   Controller "tcp:192.168.64.73:6633"
389   is_connected: true
390   fail_mode: secure
391   Port "tapa2e1ef67-79"
392   Interface "tapa2e1ef67-79"
393   Port "tap5f34d39d-5e"
394   Interface "tap5f34d39d-5e"
395   Port "tapc2858395-f9"
396   Interface "tapc2858395-f9"
397   Port "tapa9ea900a-4b"
398   Interface "tapa9ea900a-4b"
399   Port "tapc63ef3de-53"
400   Interface "tapc63ef3de-53"
401   Port "tap01d51478-8b"
402   Interface "tap01d51478-8b"
403   Port "tapa0b085ab-ce"
404   Interface "tapa0b085ab-ce"
405    Port "tapeab380de-8f"
406   Interface "tapeab380de-8f"
407   Port "tape404538c-0a"
408   Interface "tape404538c-0a"
409   Port "tap2940658d-15"
410   Interface "tap2940658d-15"
411   Port "ens224"
412   Interface "ens224"
413   ovs_version: "2.3.0"
414   <code>[stack@icehouse-controller-odl devstack]$ sudo ovs-vsctl show
415   Manager "tcp:192.168.64.73:6640"
416   is_connected: true
417   Bridge br-int
418   Controller "tcp:192.168.64.73:6633"
419   is_connected: true
420   fail_mode: secure
421   Port "tap71790d18-65"
422   Interface "tap71790d18-65"
423   Port "ens224"
424   Interface "ens224"
425   ovs_version: "2.3.0"
426
427 NOTE:In the above scenario more nodes have been created in the compute node
428
429 ===== References
430 * http://devstack.org/guides/multinode-lab.html
431 * https://wiki.opendaylight.org/view/File:Vtn_demo_hackfest_2014_march.pdf