Add Midonet plugin support to devstack.

Add support for Midokura's Midonet plugin to devstack,
in lib/neutron_plugins and lib/neutron_thirdparty.

Change-Id: I9b4d90eab09bbb21b9ba251a311620e0a21e8219
This commit is contained in:
av-mido 2013-07-11 14:59:00 +09:00
parent e7559a479e
commit 2c3428b1ed
2 changed files with 146 additions and 0 deletions

View File

@ -0,0 +1,82 @@
# Neutron MidoNet plugin
# ----------------------
# Save trace setting
MY_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:-"midonet.nova.virt.libvirt.vif.MidonetVifDriver"}
}
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_DB_NAME="neutron_midonet"
Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
}
function neutron_plugin_configure_debug_command() {
:
}
function neutron_plugin_configure_dhcp_agent() {
die $LINENO "q-dhcp must not be executed with MidoNet plugin!"
}
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_URI" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URI
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
if [[ "$MIDONET_PROVIDER_ROUTER_ID" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $MIDONET_PROVIDER_ROUTER_ID
fi
if [[ "$MIDONET_METADATA_ROUTER_ID" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $MIDONET_METADATA_ROUTER_ID
fi
}
function neutron_plugin_setup_interface_driver() {
# May change in the future
:
}
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
$MY_XTRACE

64
lib/neutron_thirdparty/midonet vendored Normal file
View File

@ -0,0 +1,64 @@
# 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_DIR/python-midonetclient
# MidoNet OpenStack repo
MIDONET_OS_REPO=${MIDONET_OS_REPO:-https://github.com/midokura/midonet-openstack.git}
MIDONET_OS_BRANCH=${MIDONET_OS_BRANCH:-master}
MIDONET_OS_DIR=$MIDONET_DIR/midonet-openstack
MIDONET_SETUP_SCRIPT=${MIDONET_SETUP_SCRIPT:-$MIDONET_OS_DIR/bin/setup_midonet_topology.py}
MIDOLMAN_LOG=${MIDOLMAN_LOG:-/var/log/midolman/midolman.log}
MIDONET_API_LOG=${MIDONET_API_LOG:-/var/log/tomcat7/midonet-api.log}
# Save trace setting
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
function configure_midonet() {
:
}
function init_midonet() {
# Initialize DB. Evaluate the output of setup_midonet_topology.py to set
# env variables for provider router ID and metadata router ID
eval `python $MIDONET_SETUP_SCRIPT admin $ADMIN_PASSWORD $ADMIN_TENANT provider_devices`
die_if_not_set $LINENO provider_router_id "Error running midonet setup script, provider_router_id was not set."
die_if_not_set $LINENO metadata_router_id "Error running midonet setup script, metadata_router_id was not set."
iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $provider_router_id
iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $metadata_router_id
}
function install_midonet() {
git_clone $MIDONET_CLIENT_REPO $MIDONET_CLIENT_DIR $MIDONET_CLIENT_BRANCH
git_clone $MIDONET_OS_REPO $MIDONET_OS_DIR $MIDONET_OS_BRANCH
export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$MIDONET_OS_DIR/src:$PYTHONPATH
}
function start_midonet() {
:
}
function stop_midonet() {
:
}
# Restore xtrace
$MY_XTRACE