blob: b3c726fe93414442300c8e503ed605ab0c4ccedf [file] [log] [blame]
av-mido2c3428b2013-07-11 14:59:00 +09001# MidoNet
2# -------
3
4# This file implements functions required to configure MidoNet as the third-party
5# system used with devstack's Neutron. To include this file, specify the following
6# variables in localrc:
7#
8# * enable_service midonet
9#
10
11# MidoNet devstack destination dir
12MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
13
14# MidoNet client repo
15MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git}
16MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master}
17MIDONET_CLIENT_DIR=$MIDONET_DIR/python-midonetclient
18
19# MidoNet OpenStack repo
20MIDONET_OS_REPO=${MIDONET_OS_REPO:-https://github.com/midokura/midonet-openstack.git}
21MIDONET_OS_BRANCH=${MIDONET_OS_BRANCH:-master}
22MIDONET_OS_DIR=$MIDONET_DIR/midonet-openstack
23MIDONET_SETUP_SCRIPT=${MIDONET_SETUP_SCRIPT:-$MIDONET_OS_DIR/bin/setup_midonet_topology.py}
24
25
26MIDOLMAN_LOG=${MIDOLMAN_LOG:-/var/log/midolman/midolman.log}
27MIDONET_API_LOG=${MIDONET_API_LOG:-/var/log/tomcat7/midonet-api.log}
28
29# Save trace setting
30MY_XTRACE=$(set +o | grep xtrace)
31set +o xtrace
32
33function configure_midonet() {
34 :
35}
36
37function init_midonet() {
38
39 # Initialize DB. Evaluate the output of setup_midonet_topology.py to set
40 # env variables for provider router ID and metadata router ID
41 eval `python $MIDONET_SETUP_SCRIPT admin $ADMIN_PASSWORD $ADMIN_TENANT provider_devices`
42 die_if_not_set $LINENO provider_router_id "Error running midonet setup script, provider_router_id was not set."
43 die_if_not_set $LINENO metadata_router_id "Error running midonet setup script, metadata_router_id was not set."
44
45 iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $provider_router_id
46 iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $metadata_router_id
47}
48
49function install_midonet() {
50 git_clone $MIDONET_CLIENT_REPO $MIDONET_CLIENT_DIR $MIDONET_CLIENT_BRANCH
51 git_clone $MIDONET_OS_REPO $MIDONET_OS_DIR $MIDONET_OS_BRANCH
52 export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$MIDONET_OS_DIR/src:$PYTHONPATH
53}
54
55function start_midonet() {
56 :
57}
58
59function stop_midonet() {
60 :
61}
62
63# Restore xtrace
64$MY_XTRACE