ODL BGP LS PCEP release notes
[docs.git] / docs / opendaylight-with-openstack / openstack-with-vtn.rst
1 OpenStack with Virtual Tenant Network
2 =====================================
3
4 This section describes using OpenDaylight with the VTN manager feature providing
5 network service for OpenStack. VTN manager utilizes the OVSDB southbound service
6 and Neutron for this implementation. The below diagram depicts the communication
7 of OpenDaylight and two virtual networks connected by an OpenFlow switch using
8 this implementation.
9
10 .. figure:: images/vtn/OpenStackDeveloperGuide.png
11
12    OpenStack Architecture
13
14 Configure OpenStack to work with OpenDaylight(VTN Feature) using PackStack
15 --------------------------------------------------------------------------
16
17 Prerequisites to install OpenStack using PackStack
18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19
20 * Fresh CentOS 7.1 minimal install
21 * Use the below commands to disable and remove Network Manager in CentOS 7.1,
22
23 .. code-block:: bash
24
25     systemctl stop NetworkManager
26     systemctl disable NetworkManager
27
28 * To make SELINUX as permissive, please open the file "/etc/sysconfig/selinux" and change it as "SELINUX=permissive".
29 * After making selinux as permissive, please restart the CentOS 7.1 machine.
30
31 Steps to install OpenStack PackStack in CentOS 7.1
32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33
34 * To install OpenStack juno, use the following command,
35
36 .. code-block:: bash
37
38     yum update -y
39     yum -y install https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm
40
41
42 * To install the packstack installer, please use the below command,
43
44 .. code-block:: bash
45
46     yum -y install openstack-packstack
47
48 * To create all-in-one setup, please use the below command,
49
50 .. code-block:: bash
51
52     packstack --allinone --provision-demo=n --provision-all-in-one-ovs-bridge=n
53
54 * This will end up with Horizon started successfully message.
55
56 Steps to install and deploy OpenDaylight in CentOS 7.1
57 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
59 * Download the latest Boron distribution code in the below link,
60
61 .. code-block:: bash
62
63     wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.5.0-Boron/distribution-karaf-0.5.0-Boron.zip
64
65
66 * Unzip the Boron distribution code by using the below command,
67
68 .. code-block:: bash
69
70     unzip distribution-karaf-0.5.0-Boron.zip
71
72 * Please do the below steps in the OpenDaylight to change jetty port,
73
74   * Change the jetty port from 8080 to something else as swift proxy of
75     OpenStack is using it.
76   * Open the file "etc/jetty.xml" and change the jetty port from 8080 to 8910
77     (we have used 8910 as jetty port you can use any other number).
78   * Start VTN Manager and install odl-vtn-manager-neutron in it.
79   * Ensure all the required ports(6633/6653,6640 and 8910) are in the listen
80     mode by using the command "netstat -tunpl" in OpenDaylight.
81
82 Steps to reconfigure OpenStack in CentOS 7.1
83 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84
85 * Steps to stop Open vSwitch Agent and clean up ovs
86
87 .. code-block:: bash
88
89     sudo systemctl stop neutron-openvswitch-agent
90     sudo systemctl disable neutron-openvswitch-agent
91     sudo systemctl stop openvswitch
92     sudo rm -rf /var/log/openvswitch/*
93     sudo rm -rf /etc/openvswitch/conf.db
94     sudo systemctl start openvswitch
95     sudo ovs-vsctl show
96
97
98 * Stop Neutron Server
99
100 .. code-block:: bash
101
102     systemctl stop neutron-server
103
104
105 * Verify that OpenDaylight's ML2 interface is working:
106
107 .. code-block:: bash
108
109     curl -v admin:admin http://{CONTROL_HOST}:{PORT}/controller/nb/v2/neutron/networks
110
111     {
112        "networks" : [ ]
113     }
114
115 If this does not work or gives an error, check Neutron's log file in
116 */var/log/neutron/server.log*. Error messages here should give
117 some clue as to what the problem is in the connection with OpenDaylight
118
119 * Configure Neutron to use OpenDaylight's ML2 driver:
120
121 .. code-block:: bash
122
123     sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers opendaylight
124     sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types local
125     sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers local
126     sudo crudini --set /etc/neutron/dhcp_agent.ini DEFAULT ovs_use_veth True
127
128     cat <<EOT | sudo tee -a /etc/neutron/plugins/ml2/ml2_conf.ini > /dev/null
129       [ml2_odl]
130       password = admin
131       username = admin
132       url = http://{CONTROL_HOST}:{PORT}/controller/nb/v2/neutron
133       EOT
134
135 * Reset Neutron's ML2 database
136
137 .. code-block:: bash
138
139     sudo mysql -e "drop database if exists neutron_ml2;"
140     sudo mysql -e "create database neutron_ml2 character set utf8;"
141     sudo mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';"
142     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
143
144 * Start Neutron Server
145
146 .. code-block:: bash
147
148     sudo systemctl start neutron-server
149
150 * Restart the Neutron DHCP service
151
152 .. code-block:: bash
153
154     system restart neutron-dhcp-agent.service
155
156 * At this stage, your Open vSwitch configuration should be empty:
157
158 .. code-block:: bash
159
160     [root@dneary-odl-compute2 ~]# ovs-vsctl show
161     686989e8-7113-4991-a066-1431e7277e1f
162         ovs_version: "2.3.1"
163
164
165 * Set OpenDaylight as the manager on all nodes
166
167 .. code-block:: bash
168
169     ovs-vsctl set-manager  tcp:127.0.0.1:6640
170
171
172 * You should now see a section in your Open vSwitch configuration
173   showing that you are connected to the OpenDaylight server, and OpenDaylight
174   will automatically create a br-int bridge:
175
176 .. code-block:: bash
177
178     [root@dneary-odl-compute2 ~]# ovs-vsctl show
179     686989e8-7113-4991-a066-1431e7277e1f
180         Manager "tcp:127.0.0.1:6640"
181             is_connected: true
182         Bridge br-int
183             Controller "tcp:127.0.0.1:6633"
184                 is_connected: true
185             fail_mode: secure
186             Port "ens33"
187                 Interface "ens33"
188         ovs_version: "2.3.1"
189
190 * Add the default flow to OVS to forward packets to controller when there is a table-miss,
191
192 .. code-block:: bash
193
194     ovs-ofctl --protocols=OpenFlow13 add-flow br-int priority=0,actions=output:CONTROLLER
195
196 * Please see the `VTN OpenStack PackStack support guide <VTN_OpenStack_PackStack_>`_
197   on the wiki to create VM's from OpenStack Horizon GUI.
198
199 Implementation details
200 ----------------------
201
202 VTN Manager
203 ^^^^^^^^^^^
204 Install **odl-vtn-manager-neutron** feature which provides the integration with
205 Neutron interface.
206
207 .. code-block:: bash
208
209     feature:install odl-vtn-manager-neutron
210
211 It subscribes to the events from Open vSwitch and also implements the Neutron
212 requests received by OpenDaylight.
213
214 Functional Behavior
215 ^^^^^^^^^^^^^^^^^^^
216
217 **StartUp**
218
219 * The ML2 implementation for OpenDaylight will ensure that when Open vSwitch is
220   started, the ODL_IP_ADDRESS configured will be set as manager.
221 * When OpenDaylight receives the update of the Open vSwitch on port 6640
222   (manager port), VTN Manager handles the event and adds a bridge with required
223   port mappings to the Open vSwitch at the OpenStack node.
224 * When Neutron starts up, a new network create is POSTed to OpenDaylight, for
225   which VTN Manager creates a Virtual Tenant Network.
226 * *Network and Sub-Network Create:* Whenever a new sub network is created, VTN
227   Manager will handle the same and create a vbridge under the VTN.
228 * *VM Creation in OpenStack:* The interface mentioned as integration bridge in
229   the configuration file will be added with more interfaces on creation of a
230   new VM in OpenStack and the network is provisioned for it by the VTN Neutron
231   feature. The addition of a new port is captured by the VTN Manager and it
232   creates a vbridge interface with port mapping for the particular port. When
233   the VM starts to communicate with other VMs, the VTN Manger will install flows
234   in the Open vSwitch and other OpenFlow switches to facilitate communication
235   between them.
236
237 .. note::
238
239     To use this feature, VTN feature should be installed
240
241 Reference
242 ---------
243
244 https://wiki.opendaylight.org/images/5/5c/Integration_of_vtn_and_ovsdb_for_helium.pdf
245
246
247 .. _VTN_OpenStack_PackStack: https://wiki.opendaylight.org/view/Release/Lithium/VTN/User_Guide/Openstack_Packstack_Support