[patch] Point neutron opendaylight configs to pike
[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/pike/dhcp_agent.ini b/neutron/files/pike/dhcp_agent.ini
16 index d327e64..739dddf 100644
17 --- a/neutron/files/pike/dhcp_agent.ini
18 +++ b/neutron/files/pike/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/pike/ml2_conf.ini b/neutron/files/pike/ml2_conf.ini
37 index b61e313..02da3b1 100644
38 --- a/neutron/files/pike/ml2_conf.ini
39 +++ b/neutron/files/pike/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/pike/neutron-generic.conf.Debian b/neutron/files/pike/neutron-generic.conf.Debian
63 index 123386d..d77f6c8 100644
64 --- a/neutron/files/pike/neutron-generic.conf.Debian
65 +++ b/neutron/files/pike/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 @@ -668,7 +668,7 @@ root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
76  # needs to execute commands in Dom0 in the hypervisor of XenServer, this item
77  # should be set to 'xenapi_root_helper', so that it will keep a XenAPI session
78  # to pass commands to Dom0. (string value)
79 -root_helper_daemon = sudo neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
80 +#root_helper_daemon = <None>
81
82  # Seconds between nodes reporting state to server; should be less than
83  # agent_down_time, best if it is half or less than agent_down_time. (floating
84 @@ -2092,3 +2092,8 @@ heartbeat_rate = 2
85  # Sets the list of available ciphers. value should be a string in the OpenSSL
86  # cipher list format. (string value)
87  #ciphers = <None>
88 +
89 +{%- if neutron.backend.ovsdb_connection is defined %}
90 +[ovs]
91 +ovsdb_connection = {{ neutron.backend.ovsdb_connection }}
92 +{%- endif %}
93 diff --git a/neutron/files/pike/neutron-server.conf.Debian b/neutron/files/pike/neutron-server.conf.Debian
94 index 79376a2..a7a4645 100644
95 --- a/neutron/files/pike/neutron-server.conf.Debian
96 +++ b/neutron/files/pike/neutron-server.conf.Debian
97 @@ -50,7 +50,7 @@ core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
98  {% set l3_plugin = 'networking_ovn.l3.l3_ovn.OVNL3RouterPlugin' %}
99  {% endif %}
100
101 -service_plugins ={{ l3_plugin }}, neutron.services.metering.metering_plugin.MeteringPlugin
102 +service_plugins = {{ server.backend.get('router', l3_plugin)}}, metering
103  {%- if server.lbaas is defined -%},lbaasv2{%- endif -%}
104  {%- if fwaas.get('enabled', False) -%},{{ fwaas[fwaas.api_version]['service_plugin'] }}{%- endif -%}
105  {%- if server.get('qos', 'True') -%},neutron.services.qos.qos_plugin.QoSPlugin{%- endif -%}
106 @@ -703,7 +703,7 @@ root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
107  # needs to execute commands in Dom0 in the hypervisor of XenServer, this item
108  # should be set to 'xenapi_root_helper', so that it will keep a XenAPI session
109  # to pass commands to Dom0. (string value)
110 -root_helper_daemon = sudo neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
111 +#root_helper_daemon = <None>
112
113  # Seconds between nodes reporting state to server; should be less than
114  # agent_down_time, best if it is half or less than agent_down_time. (floating
115 @@ -2245,3 +2245,8 @@ username = {{ server.identity.user }}
116  password = {{ server.identity.password }}
117  auth_url=http://{{ server.identity.host }}:35357
118  {%- endif %}
119 +
120 +{%- if server.backend.ovsdb_connection is defined %}
121 +[ovs]
122 +ovsdb_connection = {{ server.backend.ovsdb_connection }}
123 +{%- endif %}
124 diff --git a/neutron/gateway.sls b/neutron/gateway.sls
125 index 81513d8..7ec9b91 100644
126 --- a/neutron/gateway.sls
127 +++ b/neutron/gateway.sls
128 @@ -32,6 +32,7 @@ neutron_gateway_packages:
129  /etc/neutron/dhcp_agent.ini:
130    file.managed:
131    - source: salt://neutron/files/{{ gateway.version }}/dhcp_agent.ini
132 +  - template: jinja
133    - require:
134      - pkg: neutron_gateway_packages
135