blob: 6ccd502d973c688b64b3d12011300978ad32efb8 [file] [log] [blame]
av-mido2c3428b2013-07-11 14:59:00 +09001# Neutron MidoNet plugin
2# ----------------------
3
Ryu Ishimoto18d5c832014-02-19 00:33:46 +09004MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
5MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
6MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
7
av-mido2c3428b2013-07-11 14:59:00 +09008# Save trace setting
Dean Troyere3a91602014-03-28 12:40:56 -05009MN_XTRACE=$(set +o | grep xtrace)
av-mido2c3428b2013-07-11 14:59:00 +090010set +o xtrace
11
Ian Wienandaee18c72014-02-21 15:35:08 +110012function is_neutron_ovs_base_plugin {
av-mido2c3428b2013-07-11 14:59:00 +090013 # MidoNet does not use l3-agent
14 # 0 means True here
15 return 1
16}
17
Ian Wienandaee18c72014-02-21 15:35:08 +110018function neutron_plugin_create_nova_conf {
Joe Millsa2fd2222013-10-04 11:46:10 +000019 NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
av-mido2c3428b2013-07-11 14:59:00 +090020}
21
Ian Wienandaee18c72014-02-21 15:35:08 +110022function neutron_plugin_install_agent_packages {
av-mido2c3428b2013-07-11 14:59:00 +090023 :
24}
25
Ian Wienandaee18c72014-02-21 15:35:08 +110026function neutron_plugin_configure_common {
av-mido2c3428b2013-07-11 14:59:00 +090027 Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet
28 Q_PLUGIN_CONF_FILENAME=midonet.ini
av-mido2c3428b2013-07-11 14:59:00 +090029 Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
30}
31
Ian Wienandaee18c72014-02-21 15:35:08 +110032function neutron_plugin_configure_debug_command {
av-mido2c3428b2013-07-11 14:59:00 +090033 :
34}
35
Ian Wienandaee18c72014-02-21 15:35:08 +110036function neutron_plugin_configure_dhcp_agent {
Ryu Ishimoto35f09662013-08-27 18:32:00 +090037 DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
Joe Millse4a523f2013-10-28 07:38:55 +000038 neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
Ryu Ishimoto35f09662013-08-27 18:32:00 +090039 iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
Ryu Ishimoto35f09662013-08-27 18:32:00 +090040 iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
41 iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
av-mido2c3428b2013-07-11 14:59:00 +090042}
43
Ian Wienandaee18c72014-02-21 15:35:08 +110044function neutron_plugin_configure_l3_agent {
Sean Dague3bdb9222013-10-22 08:36:16 -040045 die $LINENO "q-l3 must not be executed with MidoNet plugin!"
av-mido2c3428b2013-07-11 14:59:00 +090046}
47
Ian Wienandaee18c72014-02-21 15:35:08 +110048function neutron_plugin_configure_plugin_agent {
Sean Dague3bdb9222013-10-22 08:36:16 -040049 die $LINENO "q-agt must not be executed with MidoNet plugin!"
av-mido2c3428b2013-07-11 14:59:00 +090050}
51
Ian Wienandaee18c72014-02-21 15:35:08 +110052function neutron_plugin_configure_service {
Ryu Ishimoto18d5c832014-02-19 00:33:46 +090053 if [[ "$MIDONET_API_URL" != "" ]]; then
54 iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
av-mido2c3428b2013-07-11 14:59:00 +090055 fi
56 if [[ "$MIDONET_USERNAME" != "" ]]; then
57 iniset /$Q_PLUGIN_CONF_FILE MIDONET username $MIDONET_USERNAME
58 fi
59 if [[ "$MIDONET_PASSWORD" != "" ]]; then
60 iniset /$Q_PLUGIN_CONF_FILE MIDONET password $MIDONET_PASSWORD
61 fi
62 if [[ "$MIDONET_PROJECT_ID" != "" ]]; then
63 iniset /$Q_PLUGIN_CONF_FILE MIDONET project_id $MIDONET_PROJECT_ID
64 fi
Tomoe Sugihara81fe5f52013-11-14 20:04:44 +000065
66 Q_L3_ENABLED=True
67 Q_L3_ROUTER_PER_TENANT=True
av-mido2c3428b2013-07-11 14:59:00 +090068}
69
Ian Wienandaee18c72014-02-21 15:35:08 +110070function neutron_plugin_setup_interface_driver {
Joe Millse4a523f2013-10-28 07:38:55 +000071 local conf_file=$1
72 iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
av-mido2c3428b2013-07-11 14:59:00 +090073}
74
Ian Wienandaee18c72014-02-21 15:35:08 +110075function has_neutron_plugin_security_group {
av-mido2c3428b2013-07-11 14:59:00 +090076 # 0 means True here
77 return 0
78}
79
Ian Wienandaee18c72014-02-21 15:35:08 +110080function neutron_plugin_check_adv_test_requirements {
av-mido2c3428b2013-07-11 14:59:00 +090081 # 0 means True here
82 return 1
83}
84
85# Restore xtrace
Dean Troyere3a91602014-03-28 12:40:56 -050086$MN_XTRACE