[baremetal] PDF-based network config
[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..ba5f933 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.get('router', 'False') %}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 5ecafe3..48cec1f 100644
38 --- a/neutron/files/ocata/ml2_conf.ini
39 +++ b/neutron/files/ocata/ml2_conf.ini
40 @@ -131,7 +131,7 @@ tenant_network_types = {{ server.backend.tenant_network_types }}
41  # An ordered list of networking mechanism driver entrypoints to be loaded from
42  # the neutron.ml2.mechanism_drivers namespace. (list value)
43  #mechanism_drivers =
44 -mechanism_drivers ={%- for backend_name, mechanism in server.backend.get('mechanism', {}).iteritems() %}{{ mechanism.driver }},{%- endfor %}l2population
45 +mechanism_drivers ={%- for backend_name, mechanism in server.backend.get('mechanism', {}).iteritems() %}{{ mechanism.driver }}{%- endfor %}{%- if server.backend.engine == "ml2" %},l2population{%- endif %}
46
47  # An ordered list of extension driver entrypoints to be loaded from the
48  # neutron.ml2.extension_drivers namespace. For example: extension_drivers =
49 @@ -272,3 +272,11 @@ enable_security_group = True
50  # Use ipset to speed-up the iptables based security groups. Enabling ipset
51  # support requires that ipset is installed on L2 agent node. (boolean value)
52  #enable_ipset = true
53 +
54 +{%- if server.backend.engine == "opendaylight" %}
55 +[ml2_odl]
56 +port_binding_controller = pseudo-agentdb-binding
57 +url = http://{{ server.backend.host }}:{{ server.backend.rest_api_port }}/controller/nb/v2/neutron
58 +username = {{ server.backend.user }}
59 +password = {{ server.backend.password }}
60 +{%- endif %}
61 diff --git a/neutron/files/ocata/neutron-generic.conf.Debian b/neutron/files/ocata/neutron-generic.conf.Debian
62 index 123386d..eeaa3f4 100644
63 --- a/neutron/files/ocata/neutron-generic.conf.Debian
64 +++ b/neutron/files/ocata/neutron-generic.conf.Debian
65 @@ -33,11 +33,11 @@ state_path = /var/lib/neutron
66  #auth_strategy = keystone
67  auth_strategy = keystone
68
69 -{% if neutron.backend.engine == "ml2" %}
70 +{% if neutron.backend.engine in ["ml2", "opendaylight"] %}
71
72  core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
73
74 -service_plugins =neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
75 +service_plugins = {{ neutron.backend.get('router', 'router')}},metering
76
77  {% endif %}
78
79 @@ -2092,3 +2092,8 @@ heartbeat_rate = 2
80  # Sets the list of available ciphers. value should be a string in the OpenSSL
81  # cipher list format. (string value)
82  #ciphers = <None>
83 +
84 +{%- if neutron.backend.engine == "opendaylight" %}
85 +[ovs]
86 +ovsdb_connection = {{ neutron.backend.ovsdb_connection }}
87 +{%- endif %}
88 diff --git a/neutron/files/ocata/neutron-server b/neutron/files/ocata/neutron-server
89 index 54f6ceb..1682ee0 100644
90 --- a/neutron/files/ocata/neutron-server
91 +++ b/neutron/files/ocata/neutron-server
92 @@ -7,10 +7,10 @@
93  # neutron.conf
94  #NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini"
95
96 -{%- if server.backend.engine == "ml2" %}
97 +{%- if server.backend.engine in ["ml2", "opendaylight"] %}
98  NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/ml2/ml2_conf.ini"
99  {%- endif %}
100
101  {%- if server.backend.engine == "contrail" %}
102  NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/opencontrail/ContrailPlugin.ini"
103 -{%- endif %}
104 \ No newline at end of file
105 +{%- endif %}
106 diff --git a/neutron/files/ocata/neutron-server.conf.Debian b/neutron/files/ocata/neutron-server.conf.Debian
107 index 049544b..4e68567 100644
108 --- a/neutron/files/ocata/neutron-server.conf.Debian
109 +++ b/neutron/files/ocata/neutron-server.conf.Debian
110 @@ -39,11 +39,11 @@ api_extensions_path = extensions:/usr/lib/python2.7/dist-packages/neutron_plugin
111  core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2
112
113  service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.v2.plugin.LoadBalancerPluginV2
114 -{% elif server.backend.engine == "ml2" %}
115 +{% elif server.backend.engine in ["ml2", "opendaylight"] %}
116
117  core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
118
119 -service_plugins =neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
120 +service_plugins = {{ server.backend.get('router', 'router')}},metering
121  {%- if server.lbaas is defined -%},lbaasv2{%- endif -%}
122  {%- if fwaas.get('enabled', False) -%},{{ fwaas[fwaas.api_version]['service_plugin'] }}{%- endif -%}
123  {%- if server.get('qos', 'True') -%},neutron.services.qos.qos_plugin.QoSPlugin{%- endif -%}
124 @@ -838,7 +838,7 @@ allow_headers = {{ server.cors.allow_headers }}
125  # Deprecated group/name - [DEFAULT]/sql_connection
126  # Deprecated group/name - [DATABASE]/sql_connection
127  # Deprecated group/name - [sql]/connection
128 -{% if server.backend.engine == "ml2" %}
129 +{% if server.backend.engine in ["ml2", "opendaylight"] %}
130  connection = {{ server.database.engine }}+pymysql://{{ server.database.user }}:{{ server.database.password }}@{{ server.database.host }}/{{ server.database.name }}?charset=utf8
131  {% else %}
132  connection = sqlite:////var/lib/neutron/neutron.sqlite
133 @@ -2217,3 +2217,8 @@ service_provider = LOADBALANCERV2:Opencontrail:neutron_plugin_contrail.plugins.o
134  {% include "neutron/files/"+server.version+"/ContrailPlugin.ini" %}
135
136  {% endif %}
137 +
138 +{%- if server.backend.engine == "opendaylight" %}
139 +[ovs]
140 +ovsdb_connection = {{ server.backend.ovsdb_connection }}
141 +{%- endif %}
142 diff --git a/neutron/gateway.sls b/neutron/gateway.sls
143 index 96d7e9f..65386b4 100644
144 --- a/neutron/gateway.sls
145 +++ b/neutron/gateway.sls
146 @@ -32,6 +32,7 @@ neutron_gateway_packages:
147  /etc/neutron/dhcp_agent.ini:
148    file.managed:
149    - source: salt://neutron/files/{{ gateway.version }}/dhcp_agent.ini
150 +  - template: jinja
151    - require:
152      - pkg: neutron_gateway_packages
153
154 diff --git a/neutron/server.sls b/neutron/server.sls
155 index eff9fb8..cb9d622 100644
156 --- a/neutron/server.sls
157 +++ b/neutron/server.sls
158 @@ -72,7 +72,7 @@ neutron_server_service:
159
160  {%- endif %}
161
162 -{% if server.backend.engine == "ml2" %}
163 +{% if server.backend.engine in ["ml2", "opendaylight"] %}
164
165  /etc/neutron/plugins/ml2/ml2_conf.ini:
166    file.managed: