Sean Dague | e263c82 | 2014-12-05 14:25:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 3 | # Big Switch/FloodLight OpenFlow Controller |
| 4 | # ------------------------------------------ |
| 5 | |
| 6 | # Save trace setting |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 7 | BS3_XTRACE=$(set +o | grep xtrace) |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 8 | set +o xtrace |
| 9 | |
| 10 | BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80} |
| 11 | BS_FL_OF_PORT=${BS_FL_OF_PORT:-6633} |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 12 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 13 | function configure_bigswitch_floodlight { |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 14 | : |
| 15 | } |
| 16 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 17 | function init_bigswitch_floodlight { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 18 | install_neutron_agent_packages |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 19 | |
| 20 | echo -n "Installing OVS managed by the openflow controllers:" |
| 21 | echo ${BS_FL_CONTROLLERS_PORT} |
| 22 | |
| 23 | # Create local OVS bridge and configure it |
| 24 | sudo ovs-vsctl --no-wait -- --if-exists del-br ${OVS_BRIDGE} |
| 25 | sudo ovs-vsctl --no-wait add-br ${OVS_BRIDGE} |
| 26 | sudo ovs-vsctl --no-wait br-set-external-id ${OVS_BRIDGE} bridge-id ${OVS_BRIDGE} |
| 27 | |
| 28 | ctrls= |
Sean Dague | 16dd8b3 | 2014-02-03 09:10:54 +0900 | [diff] [blame] | 29 | for ctrl in `echo ${BS_FL_CONTROLLERS_PORT} | tr ',' ' '`; do |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 30 | ctrl=${ctrl%:*} |
| 31 | ctrls="${ctrls} tcp:${ctrl}:${BS_FL_OF_PORT}" |
| 32 | done |
| 33 | echo "Adding Network conttrollers: " ${ctrls} |
| 34 | sudo ovs-vsctl --no-wait set-controller ${OVS_BRIDGE} ${ctrls} |
| 35 | } |
| 36 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 37 | function install_bigswitch_floodlight { |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 38 | : |
| 39 | } |
| 40 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 41 | function start_bigswitch_floodlight { |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 42 | : |
| 43 | } |
| 44 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 45 | function stop_bigswitch_floodlight { |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 46 | : |
| 47 | } |
| 48 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 49 | function check_bigswitch_floodlight { |
armando-migliaccio | ef1e080 | 2014-01-02 16:33:53 -0800 | [diff] [blame] | 50 | : |
| 51 | } |
| 52 | |
Sumit Naiksatam | 4b26d31 | 2013-01-04 10:32:54 -0800 | [diff] [blame] | 53 | # Restore xtrace |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 54 | $BS3_XTRACE |