Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 1 | # Neutron Cisco plugin |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 2 | # --------------------------- |
| 3 | |
| 4 | # Save trace setting |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 5 | CISCO_XTRACE=$(set +o | grep xtrace) |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 6 | set +o xtrace |
| 7 | |
| 8 | # Scecify the VSM parameters |
| 9 | Q_CISCO_PLUGIN_VSM_IP=${Q_CISCO_PLUGIN_VSM_IP:-} |
| 10 | # Specify the VSM username |
| 11 | Q_CISCO_PLUGIN_VSM_USERNAME=${Q_CISCO_PLUGIN_VSM_USERNAME:-admin} |
| 12 | # Specify the VSM passward for above username |
| 13 | Q_CISCO_PLUGIN_VSM_PASSWORD=${Q_CISCO_PLUGIN_VSM_PASSWORD:-} |
| 14 | # Specify the uVEM integration bridge name |
| 15 | Q_CISCO_PLUGIN_INTEGRATION_BRIDGE=${Q_CISCO_PLUGIN_INTEGRATION_BRIDGE:-br-int} |
| 16 | # Specify if tunneling is enabled |
| 17 | Q_CISCO_PLUGIN_ENABLE_TUNNELING=${Q_CISCO_PLUGIN_ENABLE_TUNNELING:-True} |
| 18 | # Specify the VXLAN range |
| 19 | Q_CISCO_PLUGIN_VXLAN_ID_RANGES=${Q_CISCO_PLUGIN_VXLAN_ID_RANGES:-5000:10000} |
| 20 | # Specify the VLAN range |
| 21 | Q_CISCO_PLUGIN_VLAN_RANGES=${Q_CISCO_PLUGIN_VLAN_RANGES:-vlan:1:4094} |
| 22 | |
| 23 | # Specify ncclient package information |
| 24 | NCCLIENT_DIR=$DEST/ncclient |
| 25 | NCCLIENT_VERSION=${NCCLIENT_VERSION:-0.3.1} |
Shweta P | de3b820 | 2014-03-03 13:38:37 -0500 | [diff] [blame] | 26 | NCCLIENT_REPO=${NCCLIENT_REPO:-git://github.com/CiscoSystems/ncclient.git} |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 27 | NCCLIENT_BRANCH=${NCCLIENT_BRANCH:-master} |
| 28 | |
| 29 | # This routine put a prefix on an existing function name |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 30 | function _prefix_function { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 31 | declare -F $1 > /dev/null || die "$1 doesn't exist" |
| 32 | eval "$(echo "${2}_${1}()"; declare -f ${1} | tail -n +2)" |
| 33 | } |
| 34 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 35 | function _has_ovs_subplugin { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 36 | local subplugin |
| 37 | for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do |
| 38 | if [[ "$subplugin" == "openvswitch" ]]; then |
| 39 | return 0 |
| 40 | fi |
| 41 | done |
| 42 | return 1 |
| 43 | } |
| 44 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 45 | function _has_nexus_subplugin { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 46 | local subplugin |
| 47 | for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do |
| 48 | if [[ "$subplugin" == "nexus" ]]; then |
| 49 | return 0 |
| 50 | fi |
| 51 | done |
| 52 | return 1 |
| 53 | } |
| 54 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 55 | function _has_n1kv_subplugin { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 56 | local subplugin |
| 57 | for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do |
| 58 | if [[ "$subplugin" == "n1kv" ]]; then |
| 59 | return 0 |
| 60 | fi |
| 61 | done |
| 62 | return 1 |
| 63 | } |
| 64 | |
| 65 | # This routine populates the cisco config file with the information for |
| 66 | # a particular nexus switch |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 67 | function _config_switch { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 68 | local cisco_cfg_file=$1 |
| 69 | local switch_ip=$2 |
| 70 | local username=$3 |
| 71 | local password=$4 |
| 72 | local ssh_port=$5 |
| 73 | shift 5 |
| 74 | |
| 75 | local section="NEXUS_SWITCH:$switch_ip" |
| 76 | iniset $cisco_cfg_file $section username $username |
| 77 | iniset $cisco_cfg_file $section password $password |
| 78 | iniset $cisco_cfg_file $section ssh_port $ssh_port |
| 79 | |
| 80 | while [[ ${#@} != 0 ]]; do |
| 81 | iniset $cisco_cfg_file $section $1 $2 |
| 82 | shift 2 |
| 83 | done |
| 84 | } |
| 85 | |
| 86 | # Prefix openvswitch plugin routines with "ovs" in order to differentiate from |
| 87 | # cisco plugin routines. This means, ovs plugin routines will coexist with cisco |
| 88 | # plugin routines in this script. |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 89 | source $TOP_DIR/lib/neutron_plugins/openvswitch |
| 90 | _prefix_function neutron_plugin_create_nova_conf ovs |
| 91 | _prefix_function neutron_plugin_install_agent_packages ovs |
| 92 | _prefix_function neutron_plugin_configure_common ovs |
| 93 | _prefix_function neutron_plugin_configure_debug_command ovs |
| 94 | _prefix_function neutron_plugin_configure_dhcp_agent ovs |
| 95 | _prefix_function neutron_plugin_configure_l3_agent ovs |
| 96 | _prefix_function neutron_plugin_configure_plugin_agent ovs |
| 97 | _prefix_function neutron_plugin_configure_service ovs |
| 98 | _prefix_function neutron_plugin_setup_interface_driver ovs |
| 99 | _prefix_function has_neutron_plugin_security_group ovs |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 100 | |
| 101 | # Check the version of the installed ncclient package |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 102 | function check_ncclient_version { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 103 | python << EOF |
| 104 | version = '$NCCLIENT_VERSION' |
| 105 | import sys |
| 106 | try: |
| 107 | import pkg_resources |
| 108 | import ncclient |
| 109 | module_version = pkg_resources.get_distribution('ncclient').version |
| 110 | if version != module_version: |
| 111 | sys.exit(1) |
| 112 | except: |
| 113 | sys.exit(1) |
| 114 | EOF |
| 115 | } |
| 116 | |
| 117 | # Install the ncclient package |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 118 | function install_ncclient { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 119 | git_clone $NCCLIENT_REPO $NCCLIENT_DIR $NCCLIENT_BRANCH |
| 120 | (cd $NCCLIENT_DIR; sudo python setup.py install) |
| 121 | } |
| 122 | |
| 123 | # Check if the required version of ncclient has been installed |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 124 | function is_ncclient_installed { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 125 | # Check if the Cisco ncclient repository exists |
| 126 | if [[ -d $NCCLIENT_DIR ]]; then |
| 127 | remotes=$(cd $NCCLIENT_DIR; git remote -v | grep fetch | awk '{ print $2}') |
| 128 | for remote in $remotes; do |
| 129 | if [[ $remote == $NCCLIENT_REPO ]]; then |
| 130 | break; |
| 131 | fi |
| 132 | done |
| 133 | if [[ $remote != $NCCLIENT_REPO ]]; then |
| 134 | return 1 |
| 135 | fi |
| 136 | else |
| 137 | return 1 |
| 138 | fi |
| 139 | |
| 140 | # Check if the ncclient is installed with the right version |
| 141 | if ! check_ncclient_version; then |
| 142 | return 1 |
| 143 | fi |
| 144 | return 0 |
| 145 | } |
| 146 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 147 | function has_neutron_plugin_security_group { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 148 | if _has_ovs_subplugin; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 149 | ovs_has_neutron_plugin_security_group |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 150 | else |
| 151 | return 1 |
| 152 | fi |
| 153 | } |
| 154 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 155 | function is_neutron_ovs_base_plugin { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 156 | # Cisco uses OVS if openvswitch subplugin is deployed |
| 157 | _has_ovs_subplugin |
| 158 | return |
| 159 | } |
| 160 | |
| 161 | # populate required nova configuration parameters |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 162 | function neutron_plugin_create_nova_conf { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 163 | if _has_ovs_subplugin; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 164 | ovs_neutron_plugin_create_nova_conf |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 165 | else |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 166 | _neutron_ovs_base_configure_nova_vif_driver |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 167 | fi |
| 168 | } |
| 169 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 170 | function neutron_plugin_install_agent_packages { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 171 | # Cisco plugin uses openvswitch to operate in one of its configurations |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 172 | ovs_neutron_plugin_install_agent_packages |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | # Configure common parameters |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 176 | function neutron_plugin_configure_common { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 177 | # setup default subplugins |
| 178 | if [ ! -v Q_CISCO_PLUGIN_SUBPLUGINS ]; then |
| 179 | declare -ga Q_CISCO_PLUGIN_SUBPLUGINS |
| 180 | Q_CISCO_PLUGIN_SUBPLUGINS=(openvswitch nexus) |
| 181 | fi |
| 182 | if _has_ovs_subplugin; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 183 | ovs_neutron_plugin_configure_common |
| 184 | Q_PLUGIN_EXTRA_CONF_PATH=etc/neutron/plugins/cisco |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 185 | Q_PLUGIN_EXTRA_CONF_FILES=(cisco_plugins.ini) |
Dane LeBlanc | c68a8f6 | 2014-03-20 19:10:08 -0400 | [diff] [blame] | 186 | # Copy extra config files to /etc so that they can be modified |
| 187 | # later according to Cisco-specific localrc settings. |
| 188 | mkdir -p /$Q_PLUGIN_EXTRA_CONF_PATH |
| 189 | local f |
| 190 | local extra_conf_file |
| 191 | for (( f=0; $f < ${#Q_PLUGIN_EXTRA_CONF_FILES[@]}; f+=1 )); do |
| 192 | extra_conf_file=$Q_PLUGIN_EXTRA_CONF_PATH/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} |
| 193 | cp $NEUTRON_DIR/$extra_conf_file /$extra_conf_file |
| 194 | done |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 195 | else |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 196 | Q_PLUGIN_CONF_PATH=etc/neutron/plugins/cisco |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 197 | Q_PLUGIN_CONF_FILENAME=cisco_plugins.ini |
| 198 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 199 | Q_PLUGIN_CLASS="neutron.plugins.cisco.network_plugin.PluginV2" |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 200 | } |
| 201 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 202 | function neutron_plugin_configure_debug_command { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 203 | if _has_ovs_subplugin; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 204 | ovs_neutron_plugin_configure_debug_command |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 205 | fi |
| 206 | } |
| 207 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 208 | function neutron_plugin_configure_dhcp_agent { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 209 | iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 210 | } |
| 211 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 212 | function neutron_plugin_configure_l3_agent { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 213 | if _has_ovs_subplugin; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 214 | ovs_neutron_plugin_configure_l3_agent |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 215 | fi |
| 216 | } |
| 217 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 218 | function _configure_nexus_subplugin { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 219 | local cisco_cfg_file=$1 |
| 220 | |
| 221 | # Install a known compatible ncclient from the Cisco repository if necessary |
| 222 | if ! is_ncclient_installed; then |
| 223 | # Preserve the two global variables |
| 224 | local offline=$OFFLINE |
| 225 | local reclone=$RECLONE |
| 226 | # Change their values to allow installation |
| 227 | OFFLINE=False |
| 228 | RECLONE=yes |
| 229 | install_ncclient |
| 230 | # Restore their values |
| 231 | OFFLINE=$offline |
| 232 | RECLONE=$reclone |
| 233 | fi |
| 234 | |
| 235 | # Setup default nexus switch information |
| 236 | if [ ! -v Q_CISCO_PLUGIN_SWITCH_INFO ]; then |
| 237 | declare -A Q_CISCO_PLUGIN_SWITCH_INFO |
| 238 | HOST_NAME=$(hostname) |
| 239 | Q_CISCO_PLUGIN_SWITCH_INFO=([1.1.1.1]=stack:stack:22:${HOST_NAME}:1/10) |
| 240 | else |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 241 | iniset $cisco_cfg_file CISCO nexus_driver neutron.plugins.cisco.nexus.cisco_nexus_network_driver_v2.CiscoNEXUSDriver |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 242 | fi |
| 243 | |
| 244 | # Setup the switch configurations |
| 245 | local nswitch |
| 246 | local sw_info |
| 247 | local segment |
| 248 | local sw_info_array |
| 249 | declare -i count=0 |
| 250 | for nswitch in ${!Q_CISCO_PLUGIN_SWITCH_INFO[@]}; do |
| 251 | sw_info=${Q_CISCO_PLUGIN_SWITCH_INFO[$nswitch]} |
| 252 | sw_info_array=${sw_info//:/ } |
| 253 | sw_info_array=( $sw_info_array ) |
| 254 | count=${#sw_info_array[@]} |
| 255 | if [[ $count < 5 || $(( ($count-3) % 2 )) != 0 ]]; then |
| 256 | die $LINENO "Incorrect switch configuration: ${Q_CISCO_PLUGIN_SWITCH_INFO[$nswitch]}" |
| 257 | fi |
| 258 | _config_switch $cisco_cfg_file $nswitch ${sw_info_array[@]} |
| 259 | done |
| 260 | } |
| 261 | |
| 262 | # Configure n1kv plugin |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 263 | function _configure_n1kv_subplugin { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 264 | local cisco_cfg_file=$1 |
| 265 | |
| 266 | # populate the cisco plugin cfg file with the VSM information |
| 267 | echo "Configuring n1kv in $cisco_cfg_file-- $Q_CISCO_PLUGIN_VSM_IP $Q_CISCO_PLUGIN_VSM_USERNAME $Q_CISCO_PLUGIN_VSM_PASSWORD" |
| 268 | iniset $cisco_cfg_file N1KV:$Q_CISCO_PLUGIN_VSM_IP username $Q_CISCO_PLUGIN_VSM_USERNAME |
| 269 | iniset $cisco_cfg_file N1KV:$Q_CISCO_PLUGIN_VSM_IP password $Q_CISCO_PLUGIN_VSM_PASSWORD |
| 270 | |
| 271 | iniset $cisco_cfg_file CISCO_N1K integration_bridge $Q_CISCO_PLUGIN_INTEGRATION_BRIDGE |
| 272 | iniset $cisco_cfg_file CISCO_N1K enable_tunneling $Q_CISCO_PLUGIN_ENABLE_TUNNELING |
| 273 | iniset $cisco_cfg_file CISCO_N1K vxlan_id_ranges $Q_CISCO_PLUGIN_VXLAN_ID_RANGES |
| 274 | iniset $cisco_cfg_file CISCO_N1K network_vlan_ranges $Q_CISCO_PLUGIN_VLAN_RANGES |
| 275 | |
| 276 | # Setup the integration bridge by calling the ovs_base |
| 277 | OVS_BRIDGE=$Q_CISCO_PLUGIN_INTEGRATION_BRIDGE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 278 | _neutron_ovs_base_setup_bridge $OVS_BRIDGE |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 279 | } |
| 280 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 281 | function neutron_plugin_configure_plugin_agent { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 282 | if _has_ovs_subplugin; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 283 | ovs_neutron_plugin_configure_plugin_agent |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 284 | fi |
| 285 | } |
| 286 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 287 | function neutron_plugin_configure_service { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 288 | local subplugin |
| 289 | local cisco_cfg_file |
| 290 | |
| 291 | if _has_ovs_subplugin; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 292 | ovs_neutron_plugin_configure_service |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 293 | cisco_cfg_file=/${Q_PLUGIN_EXTRA_CONF_FILES[0]} |
| 294 | else |
| 295 | cisco_cfg_file=/$Q_PLUGIN_CONF_FILE |
| 296 | fi |
| 297 | |
| 298 | # Setup the [CISCO_PLUGINS] section |
| 299 | if [[ ${#Q_CISCO_PLUGIN_SUBPLUGINS[@]} > 2 ]]; then |
| 300 | die $LINENO "At most two subplugins are supported." |
| 301 | fi |
| 302 | |
| 303 | if _has_ovs_subplugin && _has_n1kv_subplugin; then |
| 304 | die $LINENO "OVS subplugin and n1kv subplugin cannot coexist" |
| 305 | fi |
| 306 | |
| 307 | # Setup the subplugins |
| 308 | inicomment $cisco_cfg_file CISCO_PLUGINS nexus_plugin |
| 309 | inicomment $cisco_cfg_file CISCO_PLUGINS vswitch_plugin |
| 310 | inicomment $cisco_cfg_file CISCO_TEST host |
| 311 | for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do |
| 312 | case $subplugin in |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 313 | nexus) iniset $cisco_cfg_file CISCO_PLUGINS nexus_plugin neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin;; |
| 314 | openvswitch) iniset $cisco_cfg_file CISCO_PLUGINS vswitch_plugin neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2;; |
| 315 | n1kv) iniset $cisco_cfg_file CISCO_PLUGINS vswitch_plugin neutron.plugins.cisco.n1kv.n1kv_neutron_plugin.N1kvNeutronPluginV2;; |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 316 | *) die $LINENO "Unsupported cisco subplugin: $subplugin";; |
| 317 | esac |
| 318 | done |
| 319 | |
| 320 | if _has_nexus_subplugin; then |
| 321 | _configure_nexus_subplugin $cisco_cfg_file |
| 322 | fi |
| 323 | |
| 324 | if _has_n1kv_subplugin; then |
| 325 | _configure_n1kv_subplugin $cisco_cfg_file |
| 326 | fi |
| 327 | } |
| 328 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 329 | function neutron_plugin_setup_interface_driver { |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 330 | local conf_file=$1 |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 331 | iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver |
Baodong (Robert) Li | 901419d | 2013-06-10 08:39:26 -0700 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | # Restore xtrace |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 335 | $CISCO_XTRACE |