blob: eb27ed63ddddabb942efaaba30ba74d22ddaf5cf [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"
32}
33
Ian Wienandaee18c72014-02-21 15:35:08 +110034function neutron_plugin_configure_debug_command {
av-mido2c3428b2013-07-11 14:59:00 +090035 :
36}
37
Ian Wienandaee18c72014-02-21 15:35:08 +110038function neutron_plugin_configure_dhcp_agent {
Ryu Ishimoto35f09662013-08-27 18:32:00 +090039 DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
Joe Millse4a523f2013-10-28 07:38:55 +000040 neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
Ryu Ishimoto35f09662013-08-27 18:32:00 +090041 iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
Ryu Ishimoto35f09662013-08-27 18:32:00 +090042 iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
43 iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
av-mido2c3428b2013-07-11 14:59:00 +090044}
45
Ian Wienandaee18c72014-02-21 15:35:08 +110046function neutron_plugin_configure_l3_agent {
Sean Dague3bdb9222013-10-22 08:36:16 -040047 die $LINENO "q-l3 must not be executed with MidoNet plugin!"
av-mido2c3428b2013-07-11 14:59:00 +090048}
49
Ian Wienandaee18c72014-02-21 15:35:08 +110050function neutron_plugin_configure_plugin_agent {
Sean Dague3bdb9222013-10-22 08:36:16 -040051 die $LINENO "q-agt must not be executed with MidoNet plugin!"
av-mido2c3428b2013-07-11 14:59:00 +090052}
53
Ian Wienandaee18c72014-02-21 15:35:08 +110054function neutron_plugin_configure_service {
Ryu Ishimoto18d5c832014-02-19 00:33:46 +090055 if [[ "$MIDONET_API_URL" != "" ]]; then
56 iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
av-mido2c3428b2013-07-11 14:59:00 +090057 fi
58 if [[ "$MIDONET_USERNAME" != "" ]]; then
59 iniset /$Q_PLUGIN_CONF_FILE MIDONET username $MIDONET_USERNAME
60 fi
61 if [[ "$MIDONET_PASSWORD" != "" ]]; then
62 iniset /$Q_PLUGIN_CONF_FILE MIDONET password $MIDONET_PASSWORD
63 fi
64 if [[ "$MIDONET_PROJECT_ID" != "" ]]; then
65 iniset /$Q_PLUGIN_CONF_FILE MIDONET project_id $MIDONET_PROJECT_ID
66 fi
Tomoe Sugihara81fe5f52013-11-14 20:04:44 +000067
68 Q_L3_ENABLED=True
69 Q_L3_ROUTER_PER_TENANT=True
av-mido2c3428b2013-07-11 14:59:00 +090070}
71
Ian Wienandaee18c72014-02-21 15:35:08 +110072function neutron_plugin_setup_interface_driver {
Joe Millse4a523f2013-10-28 07:38:55 +000073 local conf_file=$1
74 iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
av-mido2c3428b2013-07-11 14:59:00 +090075}
76
Ian Wienandaee18c72014-02-21 15:35:08 +110077function has_neutron_plugin_security_group {
av-mido2c3428b2013-07-11 14:59:00 +090078 # 0 means True here
79 return 0
80}
81
Ian Wienandaee18c72014-02-21 15:35:08 +110082function neutron_plugin_check_adv_test_requirements {
av-mido2c3428b2013-07-11 14:59:00 +090083 # 0 means True here
84 return 1
85}
86
87# Restore xtrace
Dean Troyere3a91602014-03-28 12:40:56 -050088$MN_XTRACE