Patch dhcp agent to avoid unwanted rescheduling 22/67722/1
authorMichael Polenchuk <mpolenchuk@mirantis.com>
Tue, 23 Apr 2019 10:42:07 +0000 (14:42 +0400)
committerMichael Polenchuk <mpolenchuk@mirantis.com>
Tue, 30 Apr 2019 07:56:30 +0000 (07:56 +0000)
Change-Id: Id49f26a2615e2fc06e94eeaf2e9200e83625e6c9
Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
(cherry picked from commit 7522bdb0e898144da2b6dc361dbdd549b39bc025)

mcp/config/states/neutron_dhcp_agent_patch [new file with mode: 0755]
mcp/config/states/neutron_gateway
mcp/config/states/openstack_ha
mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute.yml
mcp/reclass/classes/cluster/mcp-common-noha/openstack_gateway.yml
mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml.j2
mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml.j2

diff --git a/mcp/config/states/neutron_dhcp_agent_patch b/mcp/config/states/neutron_dhcp_agent_patch
new file mode 100755 (executable)
index 0000000..a9e14be
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+##############################################################################
+# Copyright (c) 2019 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
+##############################################################################
+
+# regression due to https://bugs.launchpad.net/neutron/+bug/1760047
+salt -I 'neutron:gateway' pkg.install python-neutron
+salt -I 'neutron:gateway' file.patch /usr/lib/python2.7/dist-packages/neutron/agent/dhcp/agent.py /var/tmp/dhcp_agent.patch || true
index 77b1167..06f9b77 100755 (executable)
@@ -9,4 +9,5 @@
 
 CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
 
+$(dirname "${BASH_SOURCE[0]}")/neutron_dhcp_agent_patch
 salt -I 'neutron:gateway' state.sls neutron
index 7cf4008..7c66704 100755 (executable)
@@ -52,6 +52,7 @@ salt -I 'cinder:controller:role:primary' state.sls cinder
 salt -I 'cinder:controller:role:secondary' state.sls cinder
 wait_for 3.0 "salt -I 'cinder:volume' state.sls cinder"
 
+$(dirname "${BASH_SOURCE[0]}")/neutron_dhcp_agent_patch
 salt -I 'neutron:server:role:primary' state.sls neutron
 salt -I 'neutron:server:role:secondary' state.sls neutron
 salt -I 'neutron:gateway' state.sls neutron.gateway
index 85e69b6..2375ef5 100644 (file)
@@ -71,6 +71,16 @@ parameters:
           - nospec_store_bypass_disable
           - noibrs
           - noibpb
+      file:
+        /var/tmp/dhcp_agent.patch:
+          contents: |
+            549,551c549,550
+            <                 self.schedule_resync("Duplicate IP addresses found, "
+            <                                      "DHCP cache is out of sync",
+            <                                      created_port.network_id)
+            ---
+            >                 LOG.info("Duplicate IP addresses found for %s network",
+            >                          created_port.network_id)
   neutron:
     gateway:
       vlan_aware_vms: true
index 5100add..fef8d48 100644 (file)
@@ -20,3 +20,15 @@ parameters:
       root_helper_daemon: false
       dhcp_lease_duration: 3600
       report_interval: 120
+  linux:
+    system:
+      file:
+        /var/tmp/dhcp_agent.patch:
+          contents: |
+            549,551c549,550
+            <                 self.schedule_resync("Duplicate IP addresses found, "
+            <                                      "DHCP cache is out of sync",
+            <                                      created_port.network_id)
+            ---
+            >                 LOG.info("Duplicate IP addresses found for %s network",
+            >                          created_port.network_id)
index 63eb6e2..25fc826 100644 (file)
@@ -16,8 +16,6 @@ classes:
 parameters:
   neutron:
     compute:
-      dhcp_agent_enabled: true
-      metadata_agent_enabled: true
       backend:
         tenant_network_types: ${_param:neutron_tenant_network_types}
   linux:
index 54835ac..2707c7f 100644 (file)
@@ -15,10 +15,6 @@ classes:
   - cluster.mcp-common-noha.openstack_compute
   - cluster.mcp-ovs-noha
 parameters:
-  neutron:
-    compute:
-      dhcp_agent_enabled: true
-      metadata_agent_enabled: true
   linux:
     network:
       interface: