1 .. _vtn-openstack-dev-guide:
3 OpenStack with Virtual Tenant Network
4 =====================================
6 This section describes using OpenDaylight with the VTN manager feature providing
7 network service for OpenStack. VTN manager utilizes the OVSDB southbound service
8 and Neutron for this implementation. The below diagram depicts the communication
9 of OpenDaylight and two virtual networks connected by an OpenFlow switch using
12 .. figure:: images/vtn/OpenStackDeveloperGuide.png
14 OpenStack Architecture
16 Configure OpenStack to work with OpenDaylight(VTN Feature) using PackStack
17 --------------------------------------------------------------------------
19 Prerequisites to install OpenStack using PackStack
20 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 * Fresh CentOS 7.1 minimal install
23 * Use the below commands to disable and remove Network Manager in CentOS 7.1,
27 systemctl stop NetworkManager
28 systemctl disable NetworkManager
30 * To make SELINUX as permissive, please open the file "/etc/sysconfig/selinux" and change it as "SELINUX=permissive".
31 * After making selinux as permissive, please restart the CentOS 7.1 machine.
33 Steps to install OpenStack PackStack in CentOS 7.1
34 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 * To install OpenStack juno, use the following command,
41 yum -y install https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm
44 * To install the packstack installer, please use the below command,
48 yum -y install openstack-packstack
50 * To create all-in-one setup, please use the below command,
54 packstack --allinone --provision-demo=n --provision-all-in-one-ovs-bridge=n
56 * This will end up with Horizon started successfully message.
58 Steps to install and deploy OpenDaylight in CentOS 7.1
59 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 * Download the latest Boron distribution code in the below link,
65 wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.5.0-Boron/distribution-karaf-0.5.0-Boron.zip
68 * Unzip the Boron distribution code by using the below command,
72 unzip distribution-karaf-0.5.0-Boron.zip
74 * Please do the below steps in the OpenDaylight to change jetty port,
76 * Change the jetty port from 8080 to something else as swift proxy of
77 OpenStack is using it.
78 * Open the file "etc/jetty.xml" and change the jetty port from 8080 to 8910
79 (we have used 8910 as jetty port you can use any other number).
80 * Start VTN Manager and install odl-vtn-manager-neutron in it.
81 * Ensure all the required ports(6633/6653,6640 and 8910) are in the listen
82 mode by using the command "netstat -tunpl" in OpenDaylight.
84 Steps to reconfigure OpenStack in CentOS 7.1
85 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87 * Steps to stop Open vSwitch Agent and clean up ovs
91 sudo systemctl stop neutron-openvswitch-agent
92 sudo systemctl disable neutron-openvswitch-agent
93 sudo systemctl stop openvswitch
94 sudo rm -rf /var/log/openvswitch/*
95 sudo rm -rf /etc/openvswitch/conf.db
96 sudo systemctl start openvswitch
100 * Stop Neutron Server
104 systemctl stop neutron-server
107 * Verify that OpenDaylight's ML2 interface is working:
111 curl -v admin:admin http://{CONTROL_HOST}:{PORT}/controller/nb/v2/neutron/networks
117 If this does not work or gives an error, check Neutron's log file in
118 */var/log/neutron/server.log*. Error messages here should give
119 some clue as to what the problem is in the connection with OpenDaylight
121 * Configure Neutron to use OpenDaylight's ML2 driver:
125 sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers opendaylight
126 sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types local
127 sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers local
128 sudo crudini --set /etc/neutron/dhcp_agent.ini DEFAULT ovs_use_veth True
130 cat <<EOT | sudo tee -a /etc/neutron/plugins/ml2/ml2_conf.ini > /dev/null
134 url = http://{CONTROL_HOST}:{PORT}/controller/nb/v2/neutron
137 * Reset Neutron's ML2 database
141 sudo mysql -e "drop database if exists neutron_ml2;"
142 sudo mysql -e "create database neutron_ml2 character set utf8;"
143 sudo mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';"
144 sudo neutron-db-manage --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
146 * Start Neutron Server
150 sudo systemctl start neutron-server
152 * Restart the Neutron DHCP service
156 system restart neutron-dhcp-agent.service
158 * At this stage, your Open vSwitch configuration should be empty:
162 [root@dneary-odl-compute2 ~]# ovs-vsctl show
163 686989e8-7113-4991-a066-1431e7277e1f
167 * Set OpenDaylight as the manager on all nodes
171 ovs-vsctl set-manager tcp:127.0.0.1:6640
174 * You should now see a section in your Open vSwitch configuration
175 showing that you are connected to the OpenDaylight server, and OpenDaylight
176 will automatically create a br-int bridge:
180 [root@dneary-odl-compute2 ~]# ovs-vsctl show
181 686989e8-7113-4991-a066-1431e7277e1f
182 Manager "tcp:127.0.0.1:6640"
185 Controller "tcp:127.0.0.1:6633"
192 * Add the default flow to OVS to forward packets to controller when there is a table-miss,
196 ovs-ofctl --protocols=OpenFlow13 add-flow br-int priority=0,actions=output:CONTROLLER
198 * Please see the `VTN OpenStack PackStack support guide <VTN_OpenStack_PackStack_>`_
199 on the wiki to create VM's from OpenStack Horizon GUI.
201 Implementation details
202 ----------------------
206 Install **odl-vtn-manager-neutron** feature which provides the integration with
211 feature:install odl-vtn-manager-neutron
213 It subscribes to the events from Open vSwitch and also implements the Neutron
214 requests received by OpenDaylight.
221 * The ML2 implementation for OpenDaylight will ensure that when Open vSwitch is
222 started, the ODL_IP_ADDRESS configured will be set as manager.
223 * When OpenDaylight receives the update of the Open vSwitch on port 6640
224 (manager port), VTN Manager handles the event and adds a bridge with required
225 port mappings to the Open vSwitch at the OpenStack node.
226 * When Neutron starts up, a new network create is POSTed to OpenDaylight, for
227 which VTN Manager creates a Virtual Tenant Network.
228 * *Network and Sub-Network Create:* Whenever a new sub network is created, VTN
229 Manager will handle the same and create a vbridge under the VTN.
230 * *VM Creation in OpenStack:* The interface mentioned as integration bridge in
231 the configuration file will be added with more interfaces on creation of a
232 new VM in OpenStack and the network is provisioned for it by the VTN Neutron
233 feature. The addition of a new port is captured by the VTN Manager and it
234 creates a vbridge interface with port mapping for the particular port. When
235 the VM starts to communicate with other VMs, the VTN Manger will install flows
236 in the Open vSwitch and other OpenFlow switches to facilitate communication
241 To use this feature, VTN feature should be installed
246 https://wiki.opendaylight.org/images/5/5c/Integration_of_vtn_and_ovsdb_for_helium.pdf
249 .. _VTN_OpenStack_PackStack: https://wiki.opendaylight.org/view/Release/Lithium/VTN/User_Guide/Openstack_Packstack_Support