Browse code

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

Jaume Devesa authored on 2015/02/12 02:20:46
Showing 2 changed files
... ...
@@ -1,100 +1,4 @@
1 1
 #!/bin/bash
2
-#
3
-# Neutron MidoNet plugin
4
-# ----------------------
5 2
 
6
-MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
7
-MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
8
-MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
9
-
10
-# Save trace setting
11
-MN_XTRACE=$(set +o | grep xtrace)
12
-set +o xtrace
13
-
14
-function is_neutron_ovs_base_plugin {
15
-    # MidoNet does not use l3-agent
16
-    # 0 means True here
17
-    return 1
18
-}
19
-
20
-function neutron_plugin_create_nova_conf {
21
-    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
22
-}
23
-
24
-function neutron_plugin_install_agent_packages {
25
-    :
26
-}
27
-
28
-function neutron_plugin_configure_common {
29
-    Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet
30
-    Q_PLUGIN_CONF_FILENAME=midonet.ini
31
-    Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
32
-
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
44
-}
45
-
46
-function neutron_plugin_configure_debug_command {
47
-    :
48
-}
49
-
50
-function neutron_plugin_configure_dhcp_agent {
51
-    DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
52
-    neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
53
-    iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
54
-    iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
55
-    iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
56
-}
57
-
58
-function neutron_plugin_configure_l3_agent {
59
-    die $LINENO "q-l3 must not be executed with MidoNet plugin!"
60
-}
61
-
62
-function neutron_plugin_configure_plugin_agent {
63
-    die $LINENO "q-agt must not be executed with MidoNet plugin!"
64
-}
65
-
66
-function neutron_plugin_configure_service {
67
-    if [[ "$MIDONET_API_URL" != "" ]]; then
68
-        iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
69
-    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
79
-
80
-    Q_L3_ENABLED=True
81
-    Q_L3_ROUTER_PER_TENANT=True
82
-}
83
-
84
-function neutron_plugin_setup_interface_driver {
85
-    local conf_file=$1
86
-    iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
87
-}
88
-
89
-function has_neutron_plugin_security_group {
90
-    # 0 means True here
91
-    return 0
92
-}
93
-
94
-function neutron_plugin_check_adv_test_requirements {
95
-    # 0 means True here
96
-    return 1
97
-}
98
-
99
-# Restore xtrace
100
-$MN_XTRACE
3
+# REVISIT(devvesa): This file is intentionally left empty
4
+# in order to keep Q_PLUGIN=midonet work.
101 5
deleted file mode 100644
... ...
@@ -1,51 +0,0 @@
1
-#!/bin/bash
2
-#
3
-# MidoNet
4
-# -------
5
-
6
-# This file implements functions required to configure MidoNet as the third-party
7
-# system used with devstack's Neutron.  To include this file, specify the following
8
-# variables in localrc:
9
-#
10
-# * enable_service midonet
11
-#
12
-
13
-# MidoNet devstack destination dir
14
-MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
15
-
16
-# MidoNet client repo
17
-MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git}
18
-MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master}
19
-MIDONET_CLIENT_DIR=${MIDONET_CLIENT_DIR:-$MIDONET_DIR/python-midonetclient}
20
-
21
-# Save trace setting
22
-MN3_XTRACE=$(set +o | grep xtrace)
23
-set +o xtrace
24
-
25
-function configure_midonet {
26
-    :
27
-}
28
-
29
-function init_midonet {
30
-    :
31
-}
32
-
33
-function install_midonet {
34
-    git_clone $MIDONET_CLIENT_REPO $MIDONET_CLIENT_DIR $MIDONET_CLIENT_BRANCH
35
-    export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$PYTHONPATH
36
-}
37
-
38
-function start_midonet {
39
-    :
40
-}
41
-
42
-function stop_midonet {
43
-    :
44
-}
45
-
46
-function check_midonet {
47
-    :
48
-}
49
-
50
-# Restore xtrace
51
-$MN3_XTRACE