Merge "Update opendaylight/neutron patch" into stable/euphrates
[fuel.git] / mcp / patches / 0001-opendaylight-formula-neutron.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Mirantis Inc., Enea AB and others.
3 :
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Michael Polenchuk <mpolenchuk@mirantis.com>
10 Date: Thu, 29 Jun 2017 12:05:25 +0400
11 Subject: [PATCH] Bring in opendaylight support
12
13 Change-Id: Ie9073fafccba336f94b1996bd85c98d7a7f5060b
14
15 diff --git a/neutron/files/ocata/dhcp_agent.ini b/neutron/files/ocata/dhcp_agent.ini
16 index d327e64..739dddf 100644
17 --- a/neutron/files/ocata/dhcp_agent.ini
18 +++ b/neutron/files/ocata/dhcp_agent.ini
19 @@ -1,3 +1,8 @@
20 +{%- if pillar.neutron.gateway is defined %}
21 +{%- from "neutron/map.jinja" import gateway as neutron with context %}
22 +{%- else %}
23 +{%- from "neutron/map.jinja" import compute as neutron with context %}
24 +{%- endif %}
25  [DEFAULT]
26
27  #
28 @@ -48,6 +53,7 @@ enable_isolated_metadata = True
29  # 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
30  # will be activated for all the networks. (boolean value)
31  #force_metadata = false
32 +{% if neutron.backend.router is defined %}force_metadata = True{% endif %}
33
34  # Allows for serving metadata requests coming from a dedicated metadata access network whose CIDR is 169.254.169.254/16 (or larger prefix),
35  # 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,
36 diff --git a/neutron/files/ocata/ml2_conf.ini b/neutron/files/ocata/ml2_conf.ini
37 index b61e313..02da3b1 100644
38 --- a/neutron/files/ocata/ml2_conf.ini
39 +++ b/neutron/files/ocata/ml2_conf.ini
40 @@ -134,7 +134,8 @@ tenant_network_types = {{ server.backend.tenant_network_types }}
41  {%- for mechanism_name, mechanism in server.get('backend', {}).get('mechanism', []).items() %}
42  {%- do mechanism_drivers.append(mechanism.get('driver')) if 'driver' in mechanism %}
43  {%- endfor %}
44 -{%- if "vxlan" in server.backend.tenant_network_types %}
45 +{%- set opendaylight_enabled = true if 'opendaylight' in mechanism_drivers|join else false %}
46 +{%- if "vxlan" in server.backend.tenant_network_types and not opendaylight_enabled %}
47  {%- do mechanism_drivers.append('l2population') %}
48  {%- endif %}
49  mechanism_drivers = {{ ','.join(mechanism_drivers) }}
50 @@ -311,3 +312,11 @@ ovn_nb_connection = tcp:{{ server.controller_vip }}:6641
51  ovn_sb_connection = tcp:{{ server.controller_vip }}:6642
52  ovn_l3_scheduler = leastloaded
53  {%- endif %}
54 +
55 +{%- if opendaylight_enabled %}
56 +[ml2_odl]
57 +port_binding_controller = pseudo-agentdb-binding
58 +url = http://{{ server.backend.host }}:{{ server.backend.rest_api_port }}/controller/nb/v2/neutron
59 +username = {{ server.backend.user }}
60 +password = {{ server.backend.password }}
61 +{%- endif %}
62 diff --git a/neutron/files/ocata/neutron-generic.conf.Debian b/neutron/files/ocata/neutron-generic.conf.Debian
63 index 123386d..85b8076 100644
64 --- a/neutron/files/ocata/neutron-generic.conf.Debian
65 +++ b/neutron/files/ocata/neutron-generic.conf.Debian
66 @@ -37,7 +37,7 @@ auth_strategy = keystone
67
68  core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
69
70 -service_plugins =neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
71 +service_plugins = {{ neutron.backend.get('router', 'router')}}, metering
72
73  {% endif %}
74
75 @@ -2092,3 +2092,8 @@ heartbeat_rate = 2
76  # Sets the list of available ciphers. value should be a string in the OpenSSL
77  # cipher list format. (string value)
78  #ciphers = <None>
79 +
80 +{%- if neutron.backend.ovsdb_connection is defined %}
81 +[ovs]
82 +ovsdb_connection = {{ neutron.backend.ovsdb_connection }}
83 +{%- endif %}
84 diff --git a/neutron/files/ocata/neutron-server.conf.Debian b/neutron/files/ocata/neutron-server.conf.Debian
85 index 79376a2..c9630b8 100644
86 --- a/neutron/files/ocata/neutron-server.conf.Debian
87 +++ b/neutron/files/ocata/neutron-server.conf.Debian
88 @@ -50,7 +50,7 @@ core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
89  {% set l3_plugin = 'networking_ovn.l3.l3_ovn.OVNL3RouterPlugin' %}
90  {% endif %}
91
92 -service_plugins ={{ l3_plugin }}, neutron.services.metering.metering_plugin.MeteringPlugin
93 +service_plugins = {{ server.backend.get('router', l3_plugin)}}, metering
94  {%- if server.lbaas is defined -%},lbaasv2{%- endif -%}
95  {%- if fwaas.get('enabled', False) -%},{{ fwaas[fwaas.api_version]['service_plugin'] }}{%- endif -%}
96  {%- if server.get('qos', 'True') -%},neutron.services.qos.qos_plugin.QoSPlugin{%- endif -%}
97 @@ -2245,3 +2245,8 @@ username = {{ server.identity.user }}
98  password = {{ server.identity.password }}
99  auth_url=http://{{ server.identity.host }}:35357
100  {%- endif %}
101 +
102 +{%- if server.backend.ovsdb_connection is defined %}
103 +[ovs]
104 +ovsdb_connection = {{ server.backend.ovsdb_connection }}
105 +{%- endif %}
106 diff --git a/neutron/gateway.sls b/neutron/gateway.sls
107 index 81513d8..7ec9b91 100644
108 --- a/neutron/gateway.sls
109 +++ b/neutron/gateway.sls
110 @@ -32,6 +32,7 @@ neutron_gateway_packages:
111  /etc/neutron/dhcp_agent.ini:
112    file.managed:
113    - source: salt://neutron/files/{{ gateway.version }}/dhcp_agent.ini
114 +  - template: jinja
115    - require:
116      - pkg: neutron_gateway_packages
117