1 From: Michael Polenchuk <mpolenchuk@mirantis.com>
2 Date: Thu, 29 Jun 2017 12:05:25 +0400
3 Subject: [PATCH] Bring in opendaylight support
5 Change-Id: Ie9073fafccba336f94b1996bd85c98d7a7f5060b
7 diff --git a/neutron/files/ocata/dhcp_agent.ini b/neutron/files/ocata/dhcp_agent.ini
8 index d327e64..ba5f933 100644
9 --- a/neutron/files/ocata/dhcp_agent.ini
10 +++ b/neutron/files/ocata/dhcp_agent.ini
12 +{%- if pillar.neutron.gateway is defined %}
13 +{%- from "neutron/map.jinja" import gateway as neutron with context %}
15 +{%- from "neutron/map.jinja" import compute as neutron with context %}
20 @@ -48,6 +53,7 @@ enable_isolated_metadata = True
21 # this value will force the DHCP server to append specific host routes to the DHCP request. If this option is set, then the metadata service
22 # will be activated for all the networks. (boolean value)
23 #force_metadata = false
24 +{% if neutron.backend.get('router', 'False') %}force_metadata = True{% endif %}
26 # Allows for serving metadata requests coming from a dedicated metadata access network whose CIDR is 169.254.169.254/16 (or larger prefix),
27 # and is connected to a Neutron router from which the VMs send metadata:1 request. In this case DHCP Option 121 will not be injected in VMs,
28 diff --git a/neutron/files/ocata/ml2_conf.ini b/neutron/files/ocata/ml2_conf.ini
29 index 5ecafe3..48cec1f 100644
30 --- a/neutron/files/ocata/ml2_conf.ini
31 +++ b/neutron/files/ocata/ml2_conf.ini
32 @@ -131,7 +131,7 @@ tenant_network_types = {{ server.backend.tenant_network_types }}
33 # An ordered list of networking mechanism driver entrypoints to be loaded from
34 # the neutron.ml2.mechanism_drivers namespace. (list value)
36 -mechanism_drivers ={%- for backend_name, mechanism in server.backend.get('mechanism', {}).iteritems() %}{{ mechanism.driver }},{%- endfor %}l2population
37 +mechanism_drivers ={%- for backend_name, mechanism in server.backend.get('mechanism', {}).iteritems() %}{{ mechanism.driver }}{%- endfor %}{%- if server.backend.engine == "ml2" %},l2population{%- endif %}
39 # An ordered list of extension driver entrypoints to be loaded from the
40 # neutron.ml2.extension_drivers namespace. For example: extension_drivers =
41 @@ -272,3 +272,11 @@ enable_security_group = True
42 # Use ipset to speed-up the iptables based security groups. Enabling ipset
43 # support requires that ipset is installed on L2 agent node. (boolean value)
46 +{%- if server.backend.engine == "opendaylight" %}
48 +port_binding_controller = pseudo-agentdb-binding
49 +url = http://{{ server.backend.host }}:{{ server.backend.rest_api_port }}/controller/nb/v2/neutron
50 +username = {{ server.backend.user }}
51 +password = {{ server.backend.password }}
53 diff --git a/neutron/files/ocata/neutron-generic.conf.Debian b/neutron/files/ocata/neutron-generic.conf.Debian
54 index 123386d..eeaa3f4 100644
55 --- a/neutron/files/ocata/neutron-generic.conf.Debian
56 +++ b/neutron/files/ocata/neutron-generic.conf.Debian
57 @@ -33,11 +33,11 @@ state_path = /var/lib/neutron
58 #auth_strategy = keystone
59 auth_strategy = keystone
61 -{% if neutron.backend.engine == "ml2" %}
62 +{% if neutron.backend.engine in ["ml2", "opendaylight"] %}
64 core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
66 -service_plugins =neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
67 +service_plugins = {{ neutron.backend.get('router', 'router')}},metering
71 @@ -2092,3 +2092,8 @@ heartbeat_rate = 2
72 # Sets the list of available ciphers. value should be a string in the OpenSSL
73 # cipher list format. (string value)
76 +{%- if neutron.backend.engine == "opendaylight" %}
78 +ovsdb_connection = {{ neutron.backend.ovsdb_connection }}
80 diff --git a/neutron/files/ocata/neutron-server b/neutron/files/ocata/neutron-server
81 index 54f6ceb..1682ee0 100644
82 --- a/neutron/files/ocata/neutron-server
83 +++ b/neutron/files/ocata/neutron-server
86 #NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini"
88 -{%- if server.backend.engine == "ml2" %}
89 +{%- if server.backend.engine in ["ml2", "opendaylight"] %}
90 NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/ml2/ml2_conf.ini"
93 {%- if server.backend.engine == "contrail" %}
94 NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/opencontrail/ContrailPlugin.ini"
96 \ No newline at end of file
98 diff --git a/neutron/files/ocata/neutron-server.conf.Debian b/neutron/files/ocata/neutron-server.conf.Debian
99 index 049544b..4e68567 100644
100 --- a/neutron/files/ocata/neutron-server.conf.Debian
101 +++ b/neutron/files/ocata/neutron-server.conf.Debian
102 @@ -39,11 +39,11 @@ api_extensions_path = extensions:/usr/lib/python2.7/dist-packages/neutron_plugin
103 core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2
105 service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.v2.plugin.LoadBalancerPluginV2
106 -{% elif server.backend.engine == "ml2" %}
107 +{% elif server.backend.engine in ["ml2", "opendaylight"] %}
109 core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
111 -service_plugins =neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
112 +service_plugins = {{ server.backend.get('router', 'router')}},metering
113 {%- if server.lbaas is defined -%},lbaasv2{%- endif -%}
114 {%- if fwaas.get('enabled', False) -%},{{ fwaas[fwaas.api_version]['service_plugin'] }}{%- endif -%}
115 {%- if server.get('qos', 'True') -%},neutron.services.qos.qos_plugin.QoSPlugin{%- endif -%}
116 @@ -838,7 +838,7 @@ allow_headers = {{ server.cors.allow_headers }}
117 # Deprecated group/name - [DEFAULT]/sql_connection
118 # Deprecated group/name - [DATABASE]/sql_connection
119 # Deprecated group/name - [sql]/connection
120 -{% if server.backend.engine == "ml2" %}
121 +{% if server.backend.engine in ["ml2", "opendaylight"] %}
122 connection = {{ server.database.engine }}+pymysql://{{ server.database.user }}:{{ server.database.password }}@{{ server.database.host }}/{{ server.database.name }}?charset=utf8
124 connection = sqlite:////var/lib/neutron/neutron.sqlite
125 @@ -2217,3 +2217,8 @@ service_provider = LOADBALANCERV2:Opencontrail:neutron_plugin_contrail.plugins.o
126 {% include "neutron/files/"+server.version+"/ContrailPlugin.ini" %}
130 +{%- if server.backend.engine == "opendaylight" %}
132 +ovsdb_connection = {{ server.backend.ovsdb_connection }}
134 diff --git a/neutron/gateway.sls b/neutron/gateway.sls
135 index 96d7e9f..65386b4 100644
136 --- a/neutron/gateway.sls
137 +++ b/neutron/gateway.sls
138 @@ -32,6 +32,7 @@ neutron_gateway_packages:
139 /etc/neutron/dhcp_agent.ini:
141 - source: salt://neutron/files/{{ gateway.version }}/dhcp_agent.ini
144 - pkg: neutron_gateway_packages
146 diff --git a/neutron/server.sls b/neutron/server.sls
147 index eff9fb8..cb9d622 100644
148 --- a/neutron/server.sls
149 +++ b/neutron/server.sls
150 @@ -72,7 +72,7 @@ neutron_server_service:
154 -{% if server.backend.engine == "ml2" %}
155 +{% if server.backend.engine in ["ml2", "opendaylight"] %}
157 /etc/neutron/plugins/ml2/ml2_conf.ini: