Merge "Set ntp servers list"
[fuel.git] / mcp / patches / 0002-opendaylight-formula-neutron.patch
1 From: Michael Polenchuk <mpolenchuk@mirantis.com>
2 Date: Thu, 29 Jun 2017 12:05:25 +0400
3 Subject: [PATCH] Bring in opendaylight support
4
5 Change-Id: Ie9073fafccba336f94b1996bd85c98d7a7f5060b
6
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
11 @@ -1,3 +1,8 @@
12 +{%- if pillar.neutron.gateway is defined %}
13 +{%- from "neutron/map.jinja" import gateway as neutron with context %}
14 +{%- else %}
15 +{%- from "neutron/map.jinja" import compute as neutron with context %}
16 +{%- endif %}
17  [DEFAULT]
18
19  #
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 %}
25
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 0d48951..347eb15 100644
30 --- a/neutron/files/ocata/ml2_conf.ini
31 +++ b/neutron/files/ocata/ml2_conf.ini
32 @@ -269,3 +269,11 @@ enable_security_group = True
33  # Use ipset to speed-up the iptables based security groups. Enabling ipset
34  # support requires that ipset is installed on L2 agent node. (boolean value)
35  #enable_ipset = true
36 +
37 +{%- if server.backend.engine == "opendaylight" %}
38 +[ml2_odl]
39 +port_binding_controller = network-topology
40 +url = http://{{ server.backend.host }}:{{ server.backend.rest_api_port }}/controller/nb/v2/neutron
41 +username = {{ server.backend.user }}
42 +password = {{ server.backend.password }}
43 +{%- endif %}
44 diff --git a/neutron/files/ocata/neutron-generic.conf.Debian b/neutron/files/ocata/neutron-generic.conf.Debian
45 index 0dde78f..05ac805 100644
46 --- a/neutron/files/ocata/neutron-generic.conf.Debian
47 +++ b/neutron/files/ocata/neutron-generic.conf.Debian
48 @@ -33,11 +33,11 @@ state_path = /var/lib/neutron
49  #auth_strategy = keystone
50  auth_strategy = keystone
51
52 -{% if neutron.backend.engine == "ml2" %}
53 +{% if neutron.backend.engine in ["ml2", "opendaylight"] %}
54
55  core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
56
57 -service_plugins =neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
58 +service_plugins = {{ neutron.backend.get('router', 'router')}},metering
59
60  {% endif %}
61
62 @@ -2073,3 +2073,8 @@ heartbeat_rate = 2
63  # Sets the list of available ciphers. value should be a string in the OpenSSL
64  # cipher list format. (string value)
65  #ciphers = <None>
66 +
67 +{%- if neutron.backend.engine == "opendaylight" %}
68 +[ovs]
69 +ovsdb_connection = {{ neutron.backend.ovsdb_connection }}
70 +{%- endif %}
71 diff --git a/neutron/files/ocata/neutron-server b/neutron/files/ocata/neutron-server
72 index 54f6ceb..1682ee0 100644
73 --- a/neutron/files/ocata/neutron-server
74 +++ b/neutron/files/ocata/neutron-server
75 @@ -7,7 +7,7 @@
76  # neutron.conf
77  #NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini"
78
79 -{%- if server.backend.engine == "ml2" %}
80 +{%- if server.backend.engine in ["ml2", "opendaylight"] %}
81  NEUTRON_PLUGIN_CONFIG="/etc/neutron/plugins/ml2/ml2_conf.ini"
82  {%- endif %}
83
84 diff --git a/neutron/files/ocata/neutron-server.conf.Debian b/neutron/files/ocata/neutron-server.conf.Debian
85 index 229d342..ac8bdff 100644
86 --- a/neutron/files/ocata/neutron-server.conf.Debian
87 +++ b/neutron/files/ocata/neutron-server.conf.Debian
88 @@ -39,11 +39,11 @@ api_extensions_path = extensions:/usr/lib/python2.7/dist-packages/neutron_plugin
89  core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2
90
91  service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.v2.plugin.LoadBalancerPluginV2
92 -{% elif server.backend.engine == "ml2" %}
93 +{% elif server.backend.engine in ["ml2", "opendaylight"] %}
94
95  core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
96
97 -service_plugins =neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
98 +service_plugins = {{ server.backend.get('router', 'router')}},metering
99  {%- if server.lbaas is defined -%},lbaasv2{%- endif -%}
100  {%- if server.get('qos', 'True') -%},neutron.services.qos.qos_plugin.QoSPlugin{%- endif -%}
101  {%- if server.get('vlan_aware_vms', False) -%},trunk{%- endif -%}
102 @@ -835,7 +835,7 @@ allow_headers = {{ server.cors.allow_headers }}
103  # Deprecated group/name - [DEFAULT]/sql_connection
104  # Deprecated group/name - [DATABASE]/sql_connection
105  # Deprecated group/name - [sql]/connection
106 -{% if server.backend.engine == "ml2" %}
107 +{% if server.backend.engine in ["ml2", "opendaylight"] %}
108  connection = {{ server.database.engine }}+pymysql://{{ server.database.user }}:{{ server.database.password }}@{{ server.database.host }}/{{ server.database.name }}?charset=utf8
109  {% else %}
110  connection = sqlite:////var/lib/neutron/neutron.sqlite
111 @@ -2198,3 +2198,8 @@ service_provider = LOADBALANCERV2:Opencontrail:neutron_plugin_contrail.plugins.o
112  {% include "neutron/files/"+server.version+"/ContrailPlugin.ini" %}
113
114  {% endif %}
115 +
116 +{%- if server.backend.engine == "opendaylight" %}
117 +[ovs]
118 +ovsdb_connection = {{ server.backend.ovsdb_connection }}
119 +{%- endif %}
120 diff --git a/neutron/gateway.sls b/neutron/gateway.sls
121 index a6e6586..ab4bb85 100644
122 --- a/neutron/gateway.sls
123 +++ b/neutron/gateway.sls
124 @@ -27,6 +27,7 @@ neutron_gateway_packages:
125  /etc/neutron/dhcp_agent.ini:
126    file.managed:
127    - source: salt://neutron/files/{{ gateway.version }}/dhcp_agent.ini
128 +  - template: jinja
129    - require:
130      - pkg: neutron_gateway_packages
131
132 diff --git a/neutron/server.sls b/neutron/server.sls
133 index 0b3a6be..7a6bd23 100644
134 --- a/neutron/server.sls
135 +++ b/neutron/server.sls
136 @@ -64,7 +64,7 @@ neutron_server_service:
137
138  {%- endif %}
139
140 -{% if server.backend.engine == "ml2" %}
141 +{% if server.backend.engine in ["ml2", "opendaylight"] %}
142
143  /etc/neutron/plugins/ml2/ml2_conf.ini:
144    file.managed: