aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/patches/0001-Filter-out-OpenDaylight-client-on-computes.patch
blob: f3ed7847dfb7a8be3c1d2eb189c9dcfd75a0dff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: Copyright (c) 2018 Mirantis Inc., Enea AB and others.
:
: All rights reserved. This program and the accompanying materials
: are made available under the terms of the Apache License, Version 2.0
: which accompanies this distribution, and is available at
: http://www.apache.org/licenses/LICENSE-2.0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
From: Michael Polenchuk <mpolenchuk@mirantis.com>
Date: Mon, 12 Mar 2018 16:32:50 +0400
Subject: [PATCH] Filter out OpenDaylight client on computes

OpenDaylight uses pseudo agents to manage network ports,
therefore detach unwanted ovs agent & etc. from compute state.
Also swap the set-manager target with tunnel_ip/provider_mappings
settings since ovs host config should be in place before manager setup.

Change-Id: I07cd760fdb4ce84aba21450af9246c8c9128118f

diff --git a/neutron/compute.sls b/neutron/compute.sls
index 418282d..e83a5b7 100644
--- a/neutron/compute.sls
+++ b/neutron/compute.sls
@@ -2,6 +2,36 @@
 {%- if compute.enabled %}

 {% if compute.backend.engine == "ml2" %}
+
+{% if compute.get('dhcp_agent_enabled', False) %}
+neutron_dhcp_agent_packages:
+  pkg.installed:
+  - names:
+    - neutron-dhcp-agent
+
+neutron_dhcp_agent:
+  service.running:
+    - enable: true
+    - names:
+      - neutron-dhcp-agent
+    - watch:
+      - file: /etc/neutron/dhcp_agent.ini
+    - require:
+      - pkg: neutron_dhcp_agent_packages
+
+/etc/neutron/dhcp_agent.ini:
+  file.managed:
+  - source: salt://neutron/files/{{ compute.version }}/dhcp_agent.ini
+  - template: jinja
+  - require:
+    - pkg: neutron_dhcp_agent_packages
+
+{% endif %}
+
+{%- if compute.opendaylight is defined %}
+include:
+  - .opendaylight.client
+{%- else %}
 neutron_compute_packages:
   pkg.installed:
   - names: {{ compute.pkgs }}
@@ -53,31 +83,6 @@ neutron_sriov_service:

 {% endif %}

-{% if compute.get('dhcp_agent_enabled', False) %}
-neutron_dhcp_agent_packages:
-  pkg.installed:
-  - names:
-    - neutron-dhcp-agent
-
-neutron_dhcp_agent:
-  service.running:
-    - enable: true
-    - names:
-      - neutron-dhcp-agent
-    - watch:
-      - file: /etc/neutron/dhcp_agent.ini
-    - require:
-      - pkg: neutron_dhcp_agent_packages
-
-/etc/neutron/dhcp_agent.ini:
-  file.managed:
-  - source: salt://neutron/files/{{ compute.version }}/dhcp_agent.ini
-  - template: jinja
-  - require:
-    - pkg: neutron_dhcp_agent_packages
-
-{% endif %}
-
 {% if compute.dvr %}

 {%- if fwaas.get('enabled', False) %}
@@ -243,10 +248,7 @@ rabbitmq_ca_neutron_compute:
 {%- endif %}
 {%- endif %}

-{%- if compute.opendaylight is defined %}
-include:
-  - .opendaylight.client
-{%- endif %}
+{%- endif %}{# !OpenDaylight #}

 {%- elif compute.backend.engine == "ovn" %}

diff --git a/neutron/opendaylight/client.sls b/neutron/opendaylight/client.sls
index 57e6bcc..bb0cf65 100644
--- a/neutron/opendaylight/client.sls
+++ b/neutron/opendaylight/client.sls
@@ -9,21 +9,16 @@ python-networking-odl:

 {%- if not grains.get('noservices', False) %}

-ovs_set_manager:
-  cmd.run:
-  - name: 'ovs-vsctl set-manager {{ neutron.opendaylight.ovsdb_server_iface }} {{ neutron.opendaylight.ovsdb_odl_iface }}'
-  - unless: 'ovs-vsctl get-manager | fgrep -x {{ neutron.opendaylight.ovsdb_odl_iface }}'
-
 ovs_set_tunnel_endpoint:
   cmd.run:
   - name: 'ovs-vsctl set Open_vSwitch . other_config:local_ip={{ neutron.opendaylight.tunnel_ip }}'
-  - unless: 'ovs-vsctl get Open_vSwitch . other_config | fgrep local_ip="{{ neutron.opendaylight.tunnel_ip }}"'
+  - unless: 'ovs-vsctl get Open_vSwitch . other_config | fgrep -q local_ip=\"{{ neutron.opendaylight.tunnel_ip }}\"'

 {%- if neutron.opendaylight.provider_mappings is defined %}
 ovs_set_provider_mappings:
   cmd.run:
   - name: 'ovs-vsctl set Open_vSwitch . other_config:provider_mappings={{ neutron.opendaylight.provider_mappings }}'
-  - unless: 'ovs-vsctl get Open_vSwitch . other_config | fgrep provider_mappings="{{ neutron.opendaylight.provider_mappings }}"'
+  - unless: 'ovs-vsctl get Open_vSwitch . other_config | fgrep -q provider_mappings=\"{{ neutron.opendaylight.provider_mappings }}\"'
 {%- endif %}

 neutron_odl_ovs_hostconfig:
@@ -32,4 +27,9 @@ neutron_odl_ovs_hostconfig:
   - require:
     - pkg: python-networking-odl

+ovs_set_manager:
+  cmd.run:
+  - name: 'ovs-vsctl set-manager {{ neutron.opendaylight.ovsdb_server_iface }} {{ neutron.opendaylight.ovsdb_odl_iface }}'
+  - unless: 'ovs-vsctl get-manager | fgrep -qx {{ neutron.opendaylight.ovsdb_odl_iface }}'
+
 {%- endif %}