1 === OpenStack with Virtual Tenant Network
2 This section describes using OpenDaylight with the VTN manager feature providing network service for OpenStack. VTN manager utilizes the OVSDB southbound service and Neutron for this implementation. The below diagram depicts the communication of OpenDaylight and two virtual networks connected by an OpenFlow switch using this implementation.
4 .OpenStack Architecture
5 image::vtn/OpenStackDeveloperGuide.png["OpenStack Architecture",width=500]
7 ==== Configure OpenStack to work with OpenDaylight(VTN Feature) using PackStack
9 ===== Prerequisites to install OpenStack using PackStack
10 * Fresh CentOS 7.1 minimal install
11 * Use the below commands to disable and remove Network Manager in CentOS 7.1,
14 # systemctl stop NetworkManager
15 # systemctl disable NetworkManager
18 * To make SELINUX as permissive, please open the file "/etc/sysconfig/selinux" and change it as "SELINUX=permissive".
19 * After making selinux as permissive, please restart the CentOS 7.1 machine.
21 ===== Steps to install OpenStack PackStack in CentOS 7.1
23 * To install OpenStack juno, use the following command,
27 # yum -y install https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm
30 * To install the packstack installer, please use the below command,
33 # yum -y install openstack-packstack
36 * To create all-in-one setup, please use the below command,
39 # packstack --allinone --provision-demo=n --provision-all-in-one-ovs-bridge=n
42 * This will end up with Horizon started successfully message.
44 ===== Steps to install and deploy OpenDaylight in CentOS 7.1
45 * Download the latest lithium distribution code in the below link,
48 # wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.3.1-Lithium-SR1/distribution-karaf-0.3.1-Lithium-SR1.zip
51 * Unzip the lithium distribution code by using the below command,
54 # unzip distribution-karaf-0.3.1-Lithium-SR1.zip
57 * Please do the below steps in the OpenDaylight to change jetty port,
58 ** Change the jetty port from 8080 to something else as swift proxy of OpenStack is using it.
59 ** Open the file "etc/jetty.xml" and change the jetty port from 8080 to 8910 (we have used 8910 as jetty port you can use any other number).
60 ** Start VTN Manager and install odl-vtn-manager-neutron in it.
61 ** Ensure all the required ports(6633/6653,6640 and 8910) are in the listen mode by using the command "netstat -tunpl" in OpenDaylight.
63 ===== Steps to reconfigure OpenStack in CentOS 7.1
64 * Steps to stop Open vSwitch Agent and clean up ovs
67 # sudo systemctl stop neutron-openvswitch-agent
68 # sudo systemctl disable neutron-openvswitch-agent
69 # sudo systemctl stop openvswitch
70 # sudo rm -rf /var/log/openvswitch/*
71 # sudo rm -rf /etc/openvswitch/conf.db
72 # sudo systemctl start openvswitch
79 # systemctl stop neutron-server
82 * Verify that OpenDaylight's ML2 interface is working:
85 curl -v admin:admin http://{CONTROL_HOST}:{PORT}/controller/nb/v2/neutron/networks
92 If this does not work or gives an error, check Neutron's log file in
93 +/var/log/neutron/server.log+. Error messages here should give
94 some clue as to what the problem is in the connection with OpenDaylight
96 * Configure Neutron to use OpenDaylight's ML2 driver:
99 # sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers opendaylight
100 # sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types local
101 # sudo crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers local
102 # sudo crudini --set /etc/neutron/dhcp_agent.ini DEFAULT ovs_use_veth True
104 # cat <<EOT | sudo tee -a /etc/neutron/plugins/ml2/ml2_conf.ini > /dev/null
108 url = http://{CONTROL_HOST}:{PORT}/controller/nb/v2/neutron
112 * Reset Neutron's ML2 database
115 # sudo mysql -e "drop database if exists neutron_ml2;"
116 # sudo mysql -e "create database neutron_ml2 character set utf8;"
117 # sudo mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';"
118 # 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
121 * Start Neutron Server
124 # sudo systemctl start neutron-server
127 * Restart the Neutron DHCP service
130 # system restart neutron-dhcp-agent.service
133 * At this stage, your Open vSwitch configuration should be empty:
136 [root@dneary-odl-compute2 ~]# ovs-vsctl show
137 686989e8-7113-4991-a066-1431e7277e1f
141 * Set OpenDaylight as the manager on all nodes
144 # ovs-vsctl set-manager tcp:127.0.0.1:6640
147 * You should now see a section in your Open vSwitch configuration
148 showing that you are connected to the OpenDaylight server, and OpenDaylight
149 will automatically create a br-int bridge:
152 [root@dneary-odl-compute2 ~]# ovs-vsctl show
153 686989e8-7113-4991-a066-1431e7277e1f
154 Manager "tcp:127.0.0.1:6640"
157 Controller "tcp:127.0.0.1:6633"
165 * Add the default flow to OVS to forward packets to controller when there is a table-miss,
168 ovs-ofctl --protocols=OpenFlow13 add-flow br-int priority=0,actions=output:CONTROLLER
171 * Please see the https://wiki.opendaylight.org/view/Release/Lithium/VTN/User_Guide/Openstack_Packstack_Support[VTN OpenStack PackStack support guide on the wiki] to create VM's from OpenStack Horizon GUI.
173 ==== Implementation details
176 Install *odl-vtn-manager-neutron* feature which provides the integration with Neutron interface.
178 feature:install odl-vtn-manager-neutron
180 It subscribes to the events from Open vSwitch and also implements the Neutron requests received by OpenDaylight.
182 ===== Functional Behavior
185 * The ML2 implementation for OpenDaylight will ensure that when Open vSwitch is started, the ODL_IP_ADDRESS configured will be set as manager.
186 * When OpenDaylight receives the update of the Open vSwitch on port 6640 (manager port), VTN Manager handles the event and adds a bridge with required port mappings to the Open vSwitch at the OpenStack node.
187 * When Neutron starts up, a new network create is POSTed to OpenDaylight, for which VTN Manager creates a Virtual Tenant Network.
188 * *Network and Sub-Network Create:* Whenever a new sub network is created, VTN Manager will handle the same and create a vbridge under the VTN.
189 * *VM Creation in OpenStack:* The interface mentioned as integration bridge in the configuration file will be added with more interfaces on creation of a new VM in OpenStack and the network is provisioned for it by the VTN Neutron feature. The addition of a new port is captured by the VTN Manager and it creates a vbridge interface with port mapping for the particular port. When the VM starts to communicate with other VMs, the VTN Manger will install flows in the Open vSwitch and other OpenFlow switches to facilitate communication between them.
192 To use this feature, VTN feature should be installed
196 https://wiki.opendaylight.org/images/5/5c/Integration_of_vtn_and_ovsdb_for_helium.pdf