Improve MidoNet integration

Since midonet has become open source, we can build it from
external plugin scripts. The way to enable it is using the devstack
plugin approach:

    disable_service n-net
    enable_service q-svc
    enable_service q-dhcp
    enable_service q-meta
    enable_plugin networking-midonet \
        http://github.com/stackforge/networking-midonet
    Q_PLUGIN=midonet

and should download and build the last master branch of midonet.

Change-Id: I795f92f9d3c97b2c35bac712c6edfc032eff345a
This commit is contained in:
Jaume Devesa 2015-02-11 17:20:46 +00:00
parent 7cffc6c992
commit 9826093202
2 changed files with 2 additions and 149 deletions

View File

@ -1,100 +1,4 @@
#!/bin/bash
#
# Neutron MidoNet plugin
# ----------------------
MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
# Save trace setting
MN_XTRACE=$(set +o | grep xtrace)
set +o xtrace
function is_neutron_ovs_base_plugin {
# MidoNet does not use l3-agent
# 0 means True here
return 1
}
function neutron_plugin_create_nova_conf {
NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
}
function neutron_plugin_install_agent_packages {
:
}
function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet
Q_PLUGIN_CONF_FILENAME=midonet.ini
Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
# MidoNet implements LBaaS API in the plugin, not as an LBaaS driver.
# In this model, the plugin references the 'neutron_lbaas' module but
# does not require starting an LBaaS service. Devstack, however, clones
# 'neutron_lbaas' only if 'lbaas' service is enabled. To get around this,
# always clone 'neutron_lbaas' so that it is made available to the plugin.
# Also, discontinue if the 'lbaas' service is enabled.
if is_service_enabled q-lbaas; then
die $LINENO "LBaaS service should be disabled for the MidoNet plugin"
fi
git_clone $NEUTRON_LBAAS_REPO $NEUTRON_LBAAS_DIR $NEUTRON_LBAAS_BRANCH
setup_develop $NEUTRON_LBAAS_DIR
}
function neutron_plugin_configure_debug_command {
:
}
function neutron_plugin_configure_dhcp_agent {
DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
}
function neutron_plugin_configure_l3_agent {
die $LINENO "q-l3 must not be executed with MidoNet plugin!"
}
function neutron_plugin_configure_plugin_agent {
die $LINENO "q-agt must not be executed with MidoNet plugin!"
}
function neutron_plugin_configure_service {
if [[ "$MIDONET_API_URL" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
fi
if [[ "$MIDONET_USERNAME" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET username $MIDONET_USERNAME
fi
if [[ "$MIDONET_PASSWORD" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET password $MIDONET_PASSWORD
fi
if [[ "$MIDONET_PROJECT_ID" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET project_id $MIDONET_PROJECT_ID
fi
Q_L3_ENABLED=True
Q_L3_ROUTER_PER_TENANT=True
}
function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
}
function has_neutron_plugin_security_group {
# 0 means True here
return 0
}
function neutron_plugin_check_adv_test_requirements {
# 0 means True here
return 1
}
# Restore xtrace
$MN_XTRACE
# REVISIT(devvesa): This file is intentionally left empty
# in order to keep Q_PLUGIN=midonet work.

View File

@ -1,51 +0,0 @@
#!/bin/bash
#
# MidoNet
# -------
# This file implements functions required to configure MidoNet as the third-party
# system used with devstack's Neutron. To include this file, specify the following
# variables in localrc:
#
# * enable_service midonet
#
# MidoNet devstack destination dir
MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
# MidoNet client repo
MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git}
MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master}
MIDONET_CLIENT_DIR=${MIDONET_CLIENT_DIR:-$MIDONET_DIR/python-midonetclient}
# Save trace setting
MN3_XTRACE=$(set +o | grep xtrace)
set +o xtrace
function configure_midonet {
:
}
function init_midonet {
:
}
function install_midonet {
git_clone $MIDONET_CLIENT_REPO $MIDONET_CLIENT_DIR $MIDONET_CLIENT_BRANCH
export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$PYTHONPATH
}
function start_midonet {
:
}
function stop_midonet {
:
}
function check_midonet {
:
}
# Restore xtrace
$MN3_XTRACE