blob: 23ad8b2020d8b7687b60e30dc62de077776c814a [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
av-mido2c3428b2013-07-11 14:59:00 +09003# Neutron MidoNet plugin
4# ----------------------
5
Ryu Ishimoto18d5c832014-02-19 00:33:46 +09006MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
7MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
8MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
9
av-mido2c3428b2013-07-11 14:59:00 +090010# Save trace setting
Dean Troyere3a91602014-03-28 12:40:56 -050011MN_XTRACE=$(set +o | grep xtrace)
av-mido2c3428b2013-07-11 14:59:00 +090012set +o xtrace
13
Ian Wienandaee18c72014-02-21 15:35:08 +110014function is_neutron_ovs_base_plugin {
av-mido2c3428b2013-07-11 14:59:00 +090015 # MidoNet does not use l3-agent
16 # 0 means True here
17 return 1
18}
19
Ian Wienandaee18c72014-02-21 15:35:08 +110020function neutron_plugin_create_nova_conf {
Joe Millsa2fd2222013-10-04 11:46:10 +000021 NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
av-mido2c3428b2013-07-11 14:59:00 +090022}
23
Ian Wienandaee18c72014-02-21 15:35:08 +110024function neutron_plugin_install_agent_packages {
av-mido2c3428b2013-07-11 14:59:00 +090025 :
26}
27
Ian Wienandaee18c72014-02-21 15:35:08 +110028function neutron_plugin_configure_common {
av-mido2c3428b2013-07-11 14:59:00 +090029 Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet
30 Q_PLUGIN_CONF_FILENAME=midonet.ini
av-mido2c3428b2013-07-11 14:59:00 +090031 Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
Ryu Ishimoto5bc95772015-01-15 17:00:03 +000032
33 # MidoNet implements LBaaS API in the plugin, not as an LBaaS driver.
34 # In this model, the plugin references the 'neutron_lbaas' module but
35 # does not require starting an LBaaS service. Devstack, however, clones
36 # 'neutron_lbaas' only if 'lbaas' service is enabled. To get around this,
37 # always clone 'neutron_lbaas' so that it is made available to the plugin.
38 # Also, discontinue if the 'lbaas' service is enabled.
39 if is_service_enabled q-lbaas; then
40 die $LINENO "LBaaS service should be disabled for the MidoNet plugin"
41 fi
42 git_clone $NEUTRON_LBAAS_REPO $NEUTRON_LBAAS_DIR $NEUTRON_LBAAS_BRANCH
43 setup_develop $NEUTRON_LBAAS_DIR
av-mido2c3428b2013-07-11 14:59:00 +090044}
45
Ian Wienandaee18c72014-02-21 15:35:08 +110046function neutron_plugin_configure_debug_command {
av-mido2c3428b2013-07-11 14:59:00 +090047 :
48}
49
Ian Wienandaee18c72014-02-21 15:35:08 +110050function neutron_plugin_configure_dhcp_agent {
Ryu Ishimoto35f09662013-08-27 18:32:00 +090051 DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
Joe Millse4a523f2013-10-28 07:38:55 +000052 neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
Ryu Ishimoto35f09662013-08-27 18:32:00 +090053 iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
Ryu Ishimoto35f09662013-08-27 18:32:00 +090054 iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
55 iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
av-mido2c3428b2013-07-11 14:59:00 +090056}
57
Ian Wienandaee18c72014-02-21 15:35:08 +110058function neutron_plugin_configure_l3_agent {
Sean Dague3bdb9222013-10-22 08:36:16 -040059 die $LINENO "q-l3 must not be executed with MidoNet plugin!"
av-mido2c3428b2013-07-11 14:59:00 +090060}
61
Ian Wienandaee18c72014-02-21 15:35:08 +110062function neutron_plugin_configure_plugin_agent {
Sean Dague3bdb9222013-10-22 08:36:16 -040063 die $LINENO "q-agt must not be executed with MidoNet plugin!"
av-mido2c3428b2013-07-11 14:59:00 +090064}
65
Ian Wienandaee18c72014-02-21 15:35:08 +110066function neutron_plugin_configure_service {
Ryu Ishimoto18d5c832014-02-19 00:33:46 +090067 if [[ "$MIDONET_API_URL" != "" ]]; then
68 iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
av-mido2c3428b2013-07-11 14:59:00 +090069 fi
70 if [[ "$MIDONET_USERNAME" != "" ]]; then
71 iniset /$Q_PLUGIN_CONF_FILE MIDONET username $MIDONET_USERNAME
72 fi
73 if [[ "$MIDONET_PASSWORD" != "" ]]; then
74 iniset /$Q_PLUGIN_CONF_FILE MIDONET password $MIDONET_PASSWORD
75 fi
76 if [[ "$MIDONET_PROJECT_ID" != "" ]]; then
77 iniset /$Q_PLUGIN_CONF_FILE MIDONET project_id $MIDONET_PROJECT_ID
78 fi
Tomoe Sugihara81fe5f52013-11-14 20:04:44 +000079
80 Q_L3_ENABLED=True
81 Q_L3_ROUTER_PER_TENANT=True
av-mido2c3428b2013-07-11 14:59:00 +090082}
83
Ian Wienandaee18c72014-02-21 15:35:08 +110084function neutron_plugin_setup_interface_driver {
Joe Millse4a523f2013-10-28 07:38:55 +000085 local conf_file=$1
86 iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
av-mido2c3428b2013-07-11 14:59:00 +090087}
88
Ian Wienandaee18c72014-02-21 15:35:08 +110089function has_neutron_plugin_security_group {
av-mido2c3428b2013-07-11 14:59:00 +090090 # 0 means True here
91 return 0
92}
93
Ian Wienandaee18c72014-02-21 15:35:08 +110094function neutron_plugin_check_adv_test_requirements {
av-mido2c3428b2013-07-11 14:59:00 +090095 # 0 means True here
96 return 1
97}
98
99# Restore xtrace
Dean Troyere3a91602014-03-28 12:40:56 -0500100$MN_XTRACE