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