Merge "Modified documents with new references for Be release"
[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. 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 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 OpenDaylight 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 ====  OpenDaylight Settings and Execution
85
86 =====  VTN Configuration for OpenStack Integration:
87
88  * VTN uses the configuration parameters from  "90-vtn-neutron.xml" file for the OpenStack integration.
89  * These values will be set for the OpenvSwitch, in all the participating OpenStack nodes.
90  * A configuration file "90-vtn-neutron.xml" will be generated automatically by following the below steps,
91  * Download the latest Beryllium karaf distribution from the below link,
92
93
94    http://www.opendaylight.org/software/downloads
95
96
97  * cd "distribution-karaf-0.4.0-Beryllium" and run karaf by using the following command "./bin/karaf".
98  * Install the below feature to generate "90-vtn-neutron.xml",
99
100 ----
101  feature:install odl-vtn-manager-neutron
102 ----
103
104  * Check "90-vtn-neutron.xml" file from the following path "distribution-karaf-0.4.0-Beryllium/etc/opendaylight/karaf/".
105
106 TIP: After running OpenDaylight, please ensure OpenDaylight listens to the ports:6633,6653, 6640 and 8080
107
108 TIP: Please allow the ports in firewall for the devstack to be able to communicate with OpenDaylight.
109
110 NOTE:
111
112 * 6633/6653 - OpenFlow Ports
113 * 6640 - Open vSwitch Manager Port
114 * 8282 - Port for REST API
115
116  * The contents of "90-vtn-neutron.xml" should be as follows:
117
118
119 bridgename=br-int
120 portname=eth1
121 protocols=OpenFlow13
122 failmode=secure
123
124  * The values of the configuration parameters must be changed based on the user environment.
125  * Especially, "portname" should be carefully configured, because if the value is wrong, OpenDaylight fails to forward packets.
126  * Other parameters works fine as is for general use cases.
127  ** bridgename
128  *** The name of the bridge in Open vSwitch, that will be created by OpenDaylight Controller.
129  *** It must be "br-int".
130  ** portname
131  *** The name of the port that will be created in the vbridge in Open vSwitch.
132  *** 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)
133  *** By default, if 90-vtn-neutron.xml is not created, VTN uses ens33 as portname.
134  ** protocols
135  *** OpenFlow protocol through which OpenFlow Switch and Controller communicate.
136  *** The values can be OpenFlow13 or OpenFlow10.
137  ** failmode
138  *** The value can be "standalone" or "secure".
139  *** Please use "secure" for general use cases.
140
141 ====  Devstack Setup
142
143 ===== VTN Devstack Script
144 * 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.
145 The following data are needed to be set in the local.conf file:
146 * Set the Host_IP as the detection is unreliable.
147 * 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.
148 * 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.
149 * If the *_PASSWORD variables are not set, we will be prompted to enter values during the execution of stack.sh.
150 * 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.
151 * 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.
152 * Set the RABBIT_PASSWORD. This is used by messaging services used by both the nodes.
153 * Set the service password. This is used by the OpenStack services (Nova, Glance, etc) to authenticate with Keystone.
154
155 ====== DevStack Control
156 local.conf(control)
157 [source]
158 #IP Details
159 HOST_IP=<CONTROL_NODE_MANAGEMENT_IF_IP_ADDRESS>#Please Add The Control Node IP Address in this line
160 FLAT_INTERFACE=<FLAT_INTERFACE_NAME>
161 SERVICE_HOST=$HOST_IP
162 #Instance Details
163 MULTI_HOST=1
164 #config Details
165 RECLONE=yes #Make it "no" after stacking successfully the first time
166 VERBOSE=True
167 LOG_COLOR=True
168 LOGFILE=/opt/stack/logs/stack.sh.log
169 SCREEN_LOGDIR=/opt/stack/logs
170 #OFFLINE=True #Uncomment this after stacking successfully the first time
171 #Passwords
172 ADMIN_PASSWORD=labstack
173 MYSQL_PASSWORD=supersecret
174 RABBIT_PASSWORD=supersecret
175 SERVICE_PASSWORD=supersecret
176 SERVICE_TOKEN=supersecrettoken
177 ENABLE_TENANT_TUNNELS=false
178 #Services
179 disable_service rabbit
180 enable_service qpid
181 enable_service quantum
182 enable_service n-cpu
183 enable_service n-cond
184 disable_service n-net
185 enable_service q-svc
186 enable_service q-dhcp
187 enable_service q-meta
188 enable_service horizon
189 enable_service quantum
190 enable_service tempest
191 ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth,n-cauth,nova
192 ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
193 #ML2 Details
194 Q_PLUGIN=ml2
195 Q_ML2_PLUGIN_MECHANISM_DRIVERS=opendaylight
196 Q_ML2_TENANT_NETWORK_TYPE=local
197 Q_ML2_PLUGIN_TYPE_DRIVERS=local
198 disable_service n-net
199 enable_service q-svc
200 enable_service q-dhcp
201 enable_service q-meta
202 enable_service neutron
203 enable_service odl-compute
204 ODL_MGR_IP=<ODL_IP_ADDRESS> #Please Add the ODL IP Address in this line
205 OVS_PHYSICAL_BRIDGE=br-int
206 Q_OVS_USE_VETH=True
207 url=http://<ODL_IP_ADDRESS>:8080/controller/nb/v2/neutron #Please Add the ODL IP Address in this line
208 username=admin
209 password=admin
210
211 ====== DevStack Compute
212 local.conf(compute)
213 [source]
214 #IP Details
215 HOST_IP=<COMPUTE_NODE_MANAGEMENT_IP_ADDRESS> #Add the Compute node Management IP Address
216 SERVICE_HOST=<CONTROLLEr_NODE_MANAGEMENT_IP_ADDRESS> #Add the cotnrol Node Management IP Address here
217 #Instance Details
218 MULTI_HOST=1
219 #config Details
220 RECLONE=yes #Make thgis "no" after stacking successfully once
221 #OFFLINE=True #Uncomment this line after stacking successfuly first time.
222 VERBOSE=True
223 LOG_COLOR=True
224 LOGFILE=/opt/stack/logs/stack.sh.log
225 SCREEN_LOGDIR=/opt/stack/logs
226 #Passwords
227 ADMIN_PASSWORD=labstack
228 MYSQL_PASSWORD=supersecret
229 RABBIT_PASSWORD=supersecret
230 SERVICE_PASSWORD=supersecret
231 SERVICE_TOKEN=supersecrettoken
232 #Services
233 ENABLED_SERVICES=n-cpu,rabbit,neutron
234 #ML2 Details
235 Q_PLUGIN=ml2
236 Q_ML2_PLUGIN_MECHANISM_DRIVERS=opendaylight
237 Q_ML2_TENANT_NETWORK_TYPE=local
238 Q_ML2_PLUGIN_TYPE_DRIVERS=local
239 enable_service odl-compute
240 ODL_MGR_IP=<ODL_IP_ADDRESS> #ADD ODL IP address here
241 OVS_PHYSICAL_BRIDGE=br-int
242 ENABLE_TENANT_TUNNELS=false
243 Q_OVS_USE_VETH=True
244 #Details of the Control node for various services
245 [[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
246 Q_HOST=$SERVICE_HOST
247 MYSQL_HOST=$SERVICE_HOST
248 RABBIT_HOST=$SERVICE_HOST
249 GLANCE_HOSTPORT=$SERVICE_HOST:9292
250 KEYSTONE_AUTH_HOST=$SERVICE_HOST
251 KEYSTONE_SERVICE_HOST=$SERVICE_HOST
252 NOVA_VNC_ENABLED=True
253 NOVNCPROXY_URL="http://<CONTROLLER_NODE_IP_ADDRESS>:6080/vnc_auto.html" #Add Controller Node IP address
254 VNCSERVER_LISTEN=$HOST_IP
255 VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN
256
257 ====== Devstack Kilo_Liberty Control Node
258 [source]
259 #IP Details
260 HOST_IP=<CONTROL_NODE_MANAGEMENT_IF_IP_ADDRESS> #Please Add The Control Node IP Address in this line
261 SERVICE_HOST=$HOST_IP
262 LOGFILE=stack.sh.log
263 SCREEN_LOGDIR=/opt/stack/data/log
264 LOG_COLOR=False
265 disable_service n-net
266 enable_service q-svc
267 enable_service q-agt
268 enable_service q-meta
269 disable_service q-l3
270 enable_service n-cpu
271 enable_service q-dhcp
272 enable_service n-cauth
273 enable_service neutron
274 enable_service tempest
275 ADMIN_PASSWORD=labstack
276 MYSQL_PASSWORD=supersecret
277 RABBIT_PASSWORD=supersecret
278 SERVICE_PASSWORD=supersecret
279 SERVICE_TOKEN=supersecrettoken
280 ENABLE_TENANT_TUNNELS=True
281 NEUTRON_CREATE_INITIAL_NETWORKS=False
282 #enable_plugin networking-odl http://git.openstack.org/openstack/networking-odl stable/kilo # Please uncomment this line if you
283 want to use stable/kilo branch
284 #enable_plugin networking-odl http://git.openstack.org/openstack/networking-odl stable/liberty # Please uncomment this line if you
285 want to use stable/liberty branch
286 ODL_MODE=externalodl
287 ODL_MGR_IP=<ODL_IP_ADDRESS> # Please Add the ODL IP Address in this line
288 ODL_PORT=8080
289 ODL_USERNAME=admin
290 ODL_PASSWORD=admin
291 OVS_PHYSICAL_BRIDGE=br-int
292 Q_OVS_USE_VETH=True
293 Q_ML2_TENANT_NETWORK_TYPE=local
294 VNCSERVER_PROXYCLIENT_ADDRESS=$SERVICE_HOST
295 VNCSERVER_LISTEN=0.0.0.0
296 MYSQL_HOST=$SERVICE_HOST
297 RABBIT_HOST=$SERVICE_HOST
298 GLANCE_HOSTPORT=$SERVICE_HOST:9292
299 KEYSTONE_AUTH_HOST=$SERVICE_HOST
300 KEYSTONE_SERVICE_HOST=$SERVICE_HOST
301 [[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
302 [agent]
303 minimize_polling=True
304
305 ====== Devstack Kilo_Liberty Compute Node
306 [source]
307 #IP Details
308 HOST_IP=<COMPUTE_NODE_IP_ADDRESS>
309 SERVICE_HOST=<CONTROL_NODE_IP_ADDRESS>
310 LOGFILE=stack.sh.log
311 SCREEN_LOGDIR=/opt/stack/data/log
312 LOG_COLOR=False
313 RECLONE=yes # Make it "no" after stacking successfully the first time
314 #OFFLINE=True # Uncomment this after stacking successfully the first time
315 disable_all_services
316 enable_service n-cpu
317 NOVA_VNC_ENABLED=True
318 ADMIN_PASSWORD=labstack
319 MYSQL_PASSWORD=supersecret
320 RABBIT_PASSWORD=supersecret
321 SERVICE_PASSWORD=supersecret
322 SERVICE_TOKEN=supersecrettoken
323 ENABLE_TENANT_TUNNELS=True
324 NEUTRON_CREATE_INITIAL_NETWORKS=False
325 #enable_plugin networking-odl http://git.openstack.org/openstack/networking-odl stable/kilo # Please uncomment this line if you
326 want to use stable/kilo branch
327 #enable_plugin networking-odl http://git.openstack.org/openstack/networking-odl stable/liberty # Please uncomment this line if you
328 want to use stable/liberty branch
329 ODL_MODE=compute
330 ODL_MGR_IP=<ODL_IP_ADDRESS> # Please Add the ODL IP Address in this line
331 ODL_PORT=8080
332 ODL_USERNAME=admin
333 ODL_PASSWORD=admin
334 OVS_PHYSICAL_BRIDGE=br-int
335 VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP
336 VNCSERVER_LISTEN=0.0.0.0
337 MYSQL_HOST=$SERVICE_HOST
338 RABBIT_HOST=$SERVICE_HOST
339 GLANCE_HOSTPORT=$SERVICE_HOST:9292
340 KEYSTONE_AUTH_HOST=$SERVICE_HOST
341 KEYSTONE_SERVICE_HOST=$SERVICE_HOST
342 [[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
343 [agent]
344 minimize_polling=True
345
346 NOTE:
347    We have to comment OFFLINE=TRUE in local.conf files, this will make all the installations to happen automatically.
348    RECLONE=yes only when we set up the DevStack environment from scratch.
349
350 =====  Get Devstack (All nodes)
351 * Install git application using
352 ** sudo apt-get install git
353 * Get devstack
354 ** git clone https://git.openstack.org/openstack-dev/devstack;
355 * Switch to stable/Juno Version branch
356 ** cd devstack
357
358
359    git checkout stable/juno
360
361 NOTE:
362    If you want to use stable/kilo Version branch, Please execute the below command in devstack folder
363
364
365    git checkout stable/kilo
366
367 NOTE:
368    If you want to use stable/liberty Version branch, Please execute the below command in devstack folder
369
370
371    git checkout stable/liberty
372
373 ===== Stack Control Node
374
375 .local.conf: <<_devstack_control,DevStack Control>>
376
377   cd devstack in the controller node
378
379 * Copy the contents of local.conf for juno (devstack control node) from <<_devstack_control,DevStack Control>>  and save it as "local.conf" in the "devstack".
380 * Copy the contents of local.conf for kilo and liberty (devstack control node) from <<_devstack_kilo_liberty_control_node,Devstack Kilo_Liberty Control Node>> and save it as "local.conf" in the "devstack".
381 * Please modify the IP Address values as required.
382 * Stack the node
383
384   ./stack.sh
385
386 ====== Verify Control Node stacking
387 * stack.sh prints out Horizon is now available at http://<CONTROL_NODE_IP_ADDRESS>:8080/
388 * Execute the command 'sudo ovs-vsctl show' in the control node terminal and verify if the bridge 'br-int'  is created.
389
390 ===== Stack Compute Node
391
392 .local.conf: <<_devstack_compute,DevStack Compute>>
393
394   cd devstack in the controller node
395
396 * Copy the contents of local.conf for juno (devstack compute node) from <<_devstack_compute,DevStack Compute>> and save it as "local.conf" in the "devstack".
397 * Copy the contents of local.conf file for kilo and liberty (devstack compute node) from <<_devstack_kilo_liberty_compute_node,Devstack Kilo_Liberty Compute Node>> and save it as "local.conf" in the "devstack".
398 * Please modify the IP Address values as required.
399 * Stack the node
400
401
402   ./stack.sh
403
404 ====== Verify Compute Node Stacking
405 * stack.sh prints out This is your host ip: <COMPUTE_NODE_IP_ADDRESS>
406 * Execute the command 'sudo ovs-vsctl show' in the control node terminal and verify if the bridge 'br-int'  is created.
407 * The output of the ovs-vsctl show will be similar to the one seen in control node.
408
409 ===== Additional Verifications
410 * Please visit the OpenDaylight DLUX GUI after stacking all the nodes, http://<ODL_IP_ADDRESS>:8181/index.html. The switches, topology and the ports that are currently read can be validated.
411
412 TIP: If the interconnected between the Open vSwitch is not seen, Please bring up the interface for the dataplane manually using the below comamnd
413
414
415   ifup <interface_name>
416
417 TIP: Some versions of Open vSwitch, drop packets when there is a table-miss, So please add the below flow to all the nodes with Open vSwitch version (>=2.1)
418
419
420   ovs-ofctl --protocols=OpenFlow13 add-flow br-int priority=0,actions=output:CONTROLLER
421
422 TIP: Please Accept Promiscuous mode in the networks involving the interconnect.
423
424 ===== Create VM from Devstack Horizon GUI
425 * Login to http://<CONTROL_NODE_IP>:8080/ to check the horizon GUI.
426
427 .Horizon GUI
428 image::vtn/OpenStackGui.png["Horizon",width= 600]
429
430 Enter the value for User Name as admin and enter the value for Password as labstack.
431
432 * We should first ensure both the hypervisors(control node and compute node) are mapped under hypervisors by clicking on Hpervisors tab.
433
434 .Hypervisors
435 image::vtn/Hypervisors.png["Hypervisors",width=512]
436
437 * Create a new Network from Horizon GUI.
438 * Click on Networks Tab.
439 * click on the Create Network button.
440
441 .Create Network
442 image::vtn/Create_Network.png["Create Network" ,width=600]
443
444 *  A popup screen will appear.
445 *  Enter network name and click Next button.
446
447 .Step 1
448 image::vtn/Creare_Network_Step_1.png["Step 1" ,width=600]
449 * Create a sub network by giving Network Address and click Next button .
450
451 .Step 2
452 image::vtn/Create_Network_Step_2.png[Step 2,width=600]
453
454 * Specify the additional details for subnetwork (please refer the image for your reference).
455
456 .Step 3
457 image::vtn/Create_Network_Step_3.png[Step 3,width=600]
458
459 * Click Create button
460 * Create VM Instance
461 * Navigate to Instances tab in the GUI.
462
463 .Instance Creation
464 image::vtn/Instance_Creation.png["Instance Creation",width=512]
465
466 * Click on Launch Instances button.
467
468 .Launch Instance
469 image::vtn/Launch_Instance.png[Launch Instance,width=600]
470
471 * Click on Details tab to enter the VM details.For this demo we are creating Ten VM's(instances).
472
473 * 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.
474
475 .Launch Network
476 image::vtn/Launch_Instance_network.png[Launch Network,width=600]
477
478 * Ten VM's will be created.
479
480 .Load All Instances
481 image::vtn/Load_All_Instances.png[Load All Instances,width=600]
482
483 * Click on any VM displayed in the Instances tab and click the Console tab.
484
485 .Instance Console
486 image::vtn/Instance_Console.png[Instance Console,width=600]
487
488 * Login to the VM console and verify with a ping command.
489
490 .Ping
491 image::vtn/Instance_ping.png[Ping,width=600]
492
493 ===== Verification of Control and Compute Node after VM creation
494 * Every time a new VM is created, more interfaces are added to the br-int bridge in Open vSwitch.
495 * Use *sudo ovs-vsctl show* to list the number of interfaces added.
496 * Please visit the DLUX GUI to list the new nodes in every switch.
497
498 ==== Using the DLUX GUI
499 For more information see <<_using_the_opendaylight_user_interface_dlux,the chapter on DLUX>> above.
500
501 ===== References
502 * http://devstack.org/guides/multinode-lab.html
503 * https://wiki.opendaylight.org/view/File:Vtn_demo_hackfest_2014_march.pdf