This tutorial is an enhancement of our previous OpenStack deployment.
The OFSW1-3 are Zodiac FX from Northbound Networks. Zodiac supports OpenFlow, but in this tutorial ports configured as native and minimal integration with ODL is done. At the end of this tutorial, you will see all of them in the topology view of the ODL GUI.
Zodiac Fx
You can access the Zodiac console using its provided USB cable to your laptop. MacBook doesn’t need additional driver installation. Following serial console setting will be required:
speed = 115,200bps data bits = 8 parity = none stop bits = 1 CTS/RTS = off XON/XOFF = off
#let's start the configuration, #first switch: config set name OFSW1 set ip-address 192.168.1.21 set netmask 255.255.255.0 set gateway 192.168.1.1 set of-controller 192.168.1.11 set of-port 6633 delete vlan-port 1 delete vlan-port 2 delete vlan-port 3 add vlan-port 200 1 add vlan-port 200 2 add vlan-port 200 3 save restart
#second switch: config set name OFSW2 set ip-address 192.168.1.22 set netmask 255.255.255.0 set gateway 192.168.1.1 set of-controller 192.168.1.11 set of-port 6633 delete vlan-port 1 add vlan-port 200 1 save restart
#third switch: config set name OFSW3 set ip-address 192.168.1.23 set netmask 255.255.255.0 set gateway 192.168.1.1 set of-controller 192.168.1.11 set of-port 6633 delete vlan-port 1 delete vlan-port 3 add vlan-port 200 1 add vlan-port 200 3 save restart
#verify the openflow connection status: openflow show status
Note: Zodiac FX by default has two VLANs 200 which is native, 100 which is OpenFlow supported. You can create additional VLANs if you like.
OpenDaylight on The Controller Node
OpenDaylight or ODL, in short, is an opensource SDN controller based on the YANG data model. In this tutorial, we will use ODL carbon SR3 release. You may recall from Openstack tutorial, neutron uses OVS and L3 agents to provide L2 to L3 functionalities. In this tutorial, we will use NetVirt, an ODL virtualization feature instead. Neutron will be integrated with OLD and OLD will manage OVS and other L3 features.
So, let’s get started,
The prebuild version of ODL runs in an OSGi container based on Apache Karaf and it needs Java runtime environment.
#save your time: sudo su root
#neutron will be needing these: apt-get install python-networking-odl apt install python-pip pip install --upgrade pip pip install networking-odl
#install JDK and set Java path: apt-get install openjdk-8-jdk export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
#download ODL carbon SR3 and unzip: cd /usr/local/ wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.6.3-Carbon/distribution-karaf-0.6.3-Carbon.tar.gz tar -xvzf distribution-karaf-0.6.3-Carbon.tar.gz
#start Karaf, it will start ODL as a forground process: /usr/local/distribution-karaf-0.6.3-Carbon/bin/karaf
#wrapper will allow Karaf to run as a backgournd process, #once done logout from karaf: feature:install service-wrapper wrapper:install -s AUTO_START -n ODL -D "OpenDaylight Carbon SR3” logout
#update-rc will allow Karaf to start automatically after OS rebooting: ln -s /usr/local/distribution-karaf-0.6.3-Carbon/bin/ODL-service /etc/init.d/ update-rc.d ODL-service defaults /etc/init.d/ODL-service stop /etc/init.d/ODL-service start
#these are usefull command in case of deleting Karaf as service: rm /etc/init.d/ODL-service update-rc.d -f ODL-service remove
#verify Karaf is running in background: service --status-all | grep ODL /usr/local/distribution-karaf-0.6.3-Carbon/bin/status
#login to Karaf as we need to install features,
#the password is karaf:
ssh -p 8101 karaf@192.168.1.11
#install necessary features one by one, #these commands will only work on Karaf console: feature:install odl-mdsal-apidocs feature:install odl-netvirt-openstack feature:install odl-l2switch-all feature:install odl-dlux-core feature:install odl-dluxapps-nodes feature:install odl-dluxapps-topology feature:install odl-dluxapps-applications feature:install odl-restconf-all
#note: feature name must be exact and veries among ODL releases, #verify supported feature using only list argument, #these commands will only work on Karaf console: feature:list #verify installed feature using list with -i switch: feature:list -i
Now you can access ODL GUI using a browser with the following URL, username/password is admin/admin:
http://192.168.1.11:8181/index.html#/topology.
Openstack Integration on The Controller Node
You need to delete all VM instances and network entities before ODL integration with Openstack.
#figure out VM instace and delete: nova list nova delete <instance names>
#figure out the network entites: neutron subnet-list neutron router-list neutron net-list neutron port-list neutron router-port-list <router name> #now delete all of them: neutron router-interface-delete <router name> <subnet ID or name> neutron subnet-delete <subnet name> neutron net-delete <net name> neutron router-delete <router name>
#shutdown neutron and it's L2 and L3 agents: systemctl stop neutron-server systemctl stop neutron-l3-agent systemctl stop neutron-openvswitch-agent
#uninstall the agents and remove their data: apt-get remove neutron-plugin-openvswitch-agent apt-get remove neutron-l3-agent apt-get purge neutron-plugin-openvswitch-agent apt-get purge neutron-l3-agent
#reset all OVS configuration: service openvswitch-switch stop rm -rf /var/log/openvswitch/* rm -rf /var/lib/openvswitch/.conf.db.~lock~ rm -rf /var/lib/openvswitch/conf.db rm -rf /etc/openvswitch/conf.db rm -rf /etc/openvswitch/.conf.db.~lock~ service openvswitch-switch start
#allow ODL to manage OVS and define VXLAN tunnel IP,
#IP is the physical IP of the controller node,
#don't forget the "." in the middle of second command:
ovs-vsctl set-manager tcp:192.168.1.11:6640
ovs-vsctl set Open_vSwitch . other_config:local_ip=192.168.1.11
#verify using following commands: ovs-vsctl get Open_vSwitch . other_config tail -f /var/log/openvswitch/ovsdb-server.log ovs-vsctl show
#reconfigure neutron ML2 plugin to use ODL: rm /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.working.old vim /etc/neutron/plugins/ml2/ml2_conf.ini
#paste following: [DEFAULT] [ml2] type_drivers = vxlan tenant_network_types = vxlan mechanism_drivers = opendaylight [ml2_odl] password = admin username = admin url = http://192.168.1.11:8080/controller/nb/v2/neutron [securitygroup] enable_ipset = True
#change service_plugin value on neutron: vim /etc/neutron/neutron.conf #old value: service_plugins = router, new value: [DEFAULT] service_plugins = odl-router
#allow DHCP to connect to OVS automatically: vim /etc/neutron/dhcp_agent.ini #add following values: [DEFAULT] force_metadata = True [OVS] ovsdb_interface = vsctl
#we need to rebuild the neutron database using above modifications: #login to MariaDB: mysql -u root -pchangemenow #delete old DB and create new one: DROP DATABASE neutron; CREATE DATABASE neutron; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'changemenow'; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'changemenow'; exit
#populate the database and start neutron: /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron service neutron-server start
Configuration on The Compute Node:
#shutdown L2 and L3 agents: systemctl stop neutron-l3-agent systemctl stop neutron-openvswitch-agent
#uninstall the agents and remove their data: apt-get remove neutron-plugin-openvswitch-agent apt-get remove neutron-l3-agent apt-get purge neutron-plugin-openvswitch-agent apt-get purge neutron-l3-agent
#reset OVS configuration: service openvswitch-switch stop rm -rf /var/log/openvswitch/* rm -rf /var/lib/openvswitch/.conf.db.~lock~ rm -rf /var/lib/openvswitch/conf.db rm -rf /etc/openvswitch/conf.db rm -rf /etc/openvswitch/.conf.db.~lock~ service openvswitch-switch start
#handover the controll to ODL,
#set the VXLAN tunnel IP, use compute node's physical IP,
#don't ignore the "." in the second command:
ovs-vsctl set-manager tcp:192.168.1.11:6640
ovs-vsctl set Open_vSwitch . other_config:local_ip=192.168.2.11
#verify, #show command will give you the similar output as the controller: ovs-vsctl get Open_vSwitch . other_config tail -f /var/log/openvswitch/ovsdb-server.log ovs-vsctl show
Congratulation, we are done. At this point, create some Network and VM using Horizon, make sure VMs get the IP automatically. Verify the operations on ODL GUI as well.