1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2018 Mirantis Inc., Enea AB and others.
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: Mon, 12 Mar 2018 16:32:50 +0400
11 Subject: [PATCH] Filter out OpenDaylight client on computes
13 OpenDaylight uses pseudo agents to manage network ports,
14 therefore detach unwanted ovs agent & etc. from compute state.
15 Also swap the set-manager target with tunnel_ip/provider_mappings
16 settings since ovs host config should be in place before manager setup.
18 Change-Id: I07cd760fdb4ce84aba21450af9246c8c9128118f
20 diff --git a/neutron/compute.sls b/neutron/compute.sls
21 index 418282d..e83a5b7 100644
22 --- a/neutron/compute.sls
23 +++ b/neutron/compute.sls
25 {%- if compute.enabled %}
27 {% if compute.backend.engine == "ml2" %}
29 +{% if compute.get('dhcp_agent_enabled', False) %}
30 +neutron_dhcp_agent_packages:
33 + - neutron-dhcp-agent
39 + - neutron-dhcp-agent
41 + - file: /etc/neutron/dhcp_agent.ini
43 + - pkg: neutron_dhcp_agent_packages
45 +/etc/neutron/dhcp_agent.ini:
47 + - source: salt://neutron/files/{{ compute.version }}/dhcp_agent.ini
50 + - pkg: neutron_dhcp_agent_packages
54 +{%- if compute.opendaylight is defined %}
56 + - .opendaylight.client
58 neutron_compute_packages:
60 - names: {{ compute.pkgs }}
61 @@ -53,31 +83,6 @@ neutron_sriov_service:
65 -{% if compute.get('dhcp_agent_enabled', False) %}
66 -neutron_dhcp_agent_packages:
69 - - neutron-dhcp-agent
75 - - neutron-dhcp-agent
77 - - file: /etc/neutron/dhcp_agent.ini
79 - - pkg: neutron_dhcp_agent_packages
81 -/etc/neutron/dhcp_agent.ini:
83 - - source: salt://neutron/files/{{ compute.version }}/dhcp_agent.ini
86 - - pkg: neutron_dhcp_agent_packages
92 {%- if fwaas.get('enabled', False) %}
93 @@ -243,10 +248,7 @@ rabbitmq_ca_neutron_compute:
97 -{%- if compute.opendaylight is defined %}
99 - - .opendaylight.client
101 +{%- endif %}{# !OpenDaylight #}
103 {%- elif compute.backend.engine == "ovn" %}
105 diff --git a/neutron/opendaylight/client.sls b/neutron/opendaylight/client.sls
106 index 57e6bcc..79ab0a2 100644
107 --- a/neutron/opendaylight/client.sls
108 +++ b/neutron/opendaylight/client.sls
109 @@ -9,27 +9,27 @@ python-networking-odl:
111 {%- if not grains.get('noservices', False) %}
114 +neutron_odl_ovs_hostconfig:
116 - - name: 'ovs-vsctl set-manager {{ neutron.opendaylight.ovsdb_server_iface }} {{ neutron.opendaylight.ovsdb_odl_iface }}'
117 - - unless: 'ovs-vsctl get-manager | fgrep -x {{ neutron.opendaylight.ovsdb_odl_iface }}'
118 + - name: 'neutron-odl-ovs-hostconfig --noovs_dpdk'
120 + - pkg: python-networking-odl
122 ovs_set_tunnel_endpoint:
124 - name: 'ovs-vsctl set Open_vSwitch . other_config:local_ip={{ neutron.opendaylight.tunnel_ip }}'
125 - - unless: 'ovs-vsctl get Open_vSwitch . other_config | fgrep local_ip="{{ neutron.opendaylight.tunnel_ip }}"'
126 + - unless: 'ovs-vsctl get Open_vSwitch . other_config | fgrep -q local_ip=\"{{ neutron.opendaylight.tunnel_ip }}\"'
128 {%- if neutron.opendaylight.provider_mappings is defined %}
129 ovs_set_provider_mappings:
131 - name: 'ovs-vsctl set Open_vSwitch . other_config:provider_mappings={{ neutron.opendaylight.provider_mappings }}'
132 - - unless: 'ovs-vsctl get Open_vSwitch . other_config | fgrep provider_mappings="{{ neutron.opendaylight.provider_mappings }}"'
133 + - unless: 'ovs-vsctl get Open_vSwitch . other_config | fgrep -q provider_mappings=\"{{ neutron.opendaylight.provider_mappings }}\"'
136 -neutron_odl_ovs_hostconfig:
139 - - name: 'neutron-odl-ovs-hostconfig --noovs_dpdk'
141 - - pkg: python-networking-odl
142 + - name: 'ovs-vsctl set-manager {{ neutron.opendaylight.ovsdb_server_iface }} {{ neutron.opendaylight.ovsdb_odl_iface }}'
143 + - unless: 'ovs-vsctl get-manager | fgrep -qx {{ neutron.opendaylight.ovsdb_odl_iface }}'