From 172a628c5a59a8db98aed62418ebf64b8b10b392 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Wed, 14 Jul 2021 16:46:47 +0100 Subject: [PATCH] [OVN] Fix ML2/OVN + Neutron DHCP agent use case In an attempt to minimize the number of connections to the OVSDBs the ML2/OVN driver stopped connecting to the OVN dbs if the Neutron worker was a RpcWorker but, that introduced a regression for those using ML2/OVN + Neutron DHCP agent (for baremetal provisioning). Because the RpcWorker didn't have a connection to the OVN database the Neutron DHCP agent wasn't able to create the DHCP port and failed with: 2021-07-13 13:36:18.116 17 ERROR neutron.plugins.ml2.managers if not self._sb_ovn.chassis_exists(host): 2021-07-13 13:36:18.116 17 ERROR neutron.plugins.ml2.managers AttributeError: 'NoneType' object has no attribute 'chassis_exists' This patch adds the RpcWorker back to the list of workers that should connect to the OVN databases. Change-Id: I454f3b52376a02f6cc9ca9124083295631bd03d5 Closes-Bug: #1929633 Signed-off-by: Lucas Alvares Gomes (cherry picked from commit e5f19a29dcfb70ea08fa39267bc4aecd44bec2eb) --- neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py index 59b5f137c19..7923c5097a0 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py @@ -55,6 +55,7 @@ from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb import maintenance from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb import ovn_client from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb import ovn_db_sync from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb import worker +from neutron import service from neutron.services.qos.drivers.ovn import driver as qos_driver from neutron.services.segments import db as segment_service_db from neutron.services.trunk.drivers.ovn import trunk_driver @@ -225,7 +226,8 @@ class OVNMechanismDriver(api.MechanismDriver): @staticmethod def should_post_fork_initialize(worker_class): return worker_class in (neutron.wsgi.WorkerService, - worker.MaintenanceWorker) + worker.MaintenanceWorker, + service.RpcWorker) def post_fork_initialize(self, resource, event, trigger, payload=None): # Initialize API/Maintenance workers with OVN IDL connections