2 CONTROL_HOST=172.17.0.3
10 ML2_CONF=/etc/neutron/plugins/ml2/ml2_conf.ini
18 function update_ml2conf {
19 echo "Backing up and modifying ml2_conf.ini"
20 cp $ML2_CONF $ML2_CONF.bak
21 sed -i -e 's/mechanism_drivers =openvswitch/mechanism_drivers = opendaylight/g' $ML2_CONF
23 CONTROL_HOST=172.17.0.3
31 ML2_CONF=/etc/neutron/plugins/ml2/ml2_conf.ini
39 function update_ml2conf {
40 echo "Backing up and modifying ml2_conf.ini"
41 cp $ML2_CONF $ML2_CONF.bak
42 sed -i -e 's/mechanism_drivers =openvswitch/mechanism_drivers = opendaylight/g' $ML2_CONF
43 sed -i -e 's/tenant_network_types = flat,vlan,gre,vxlan/tenant_network_types = vxlan/g' $ML2_CONF
44 cat "[ml2_odl]" >> $ML2_CONF
45 cat "password = admin" >> $ML2_CONF
46 cat "username = admin" >> $ML2_CONF
47 cat "url = http://${CONTROL_HOST}:8080/controller/nb/v2/neutron" >> $ML2_CONF
50 function reset_neutrondb {
52 mysql -e "drop database if exists neutron_ml2;"
53 mysql -e "create database neutron_ml2 character set utf8;"
54 mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';"
55 neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
58 function restart_neutron {
59 echo "Restarting Neutron Server"
60 service neutron-server restart
61 echo "Should see Neutron runing now"
62 service neutron-server status
63 echo "Shouldnt be any nets, but should work (return empty)"
67 function stop_neutron {
68 echo "Stopping Neutron / OVS components"
69 service neutron-plugin-openvswitch-agent stop
72 service neutron-server stop
78 function verify_ML2_working {
79 echo "checking that we can talk via ML2 properly"
80 curl -u admin:admin http://${CONTROL_HOST}:8080/controller/nb/v2/neutron/networks > /tmp/check_ml2
81 if grep "network" /tmp/check_ml2
83 echo "Success - ML2 to ODL is working"
85 echo "im sorry Jim, but its dead"
92 if df -k | grep glance
94 echo "Controller Mode"
103 echo "Stopping OpenVSwitch"
104 service openvswitch-switch stop
108 function control_setup {
109 echo "do control stuff here"
110 echo "Reset Neutron DB"
112 echo "Restarting Neutron Components"
114 echo "Verifying ODL ML2 plugin is working"
119 function compute_setup {
120 echo "do compute stuff here"
127 echo "Starting to make call"
134 echo "Calling control setup"
136 elif [ $MODE == "1" ];
138 echo "Calling compute setup"
142 echo "Something is bad - call for help"