From ccf2efdd3eaf3b3a5e56ef53a106ddca9fc8d771 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Tue, 8 Aug 2023 15:35:53 +0200 Subject: [PATCH] Add more logging for lrp scheduling on gtws Currently it is not entirely clear from the logs of the neutron-api, on which gateway chassis and with what priority a Logical Router Port is scheduled in OVN. This commit introduces logging to have better visibility where a LRP is scheduled and which gateway gets what priority. Change-Id: I54dec6a6a6ab0989205898bab509ec69151b6dfb --- .../ml2/drivers/ovn/mech_driver/ovsdb/commands.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py index 2faadf0aa1b..ef1aadce186 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py @@ -23,6 +23,10 @@ from neutron.common.ovn import exceptions as ovn_exc from neutron.common.ovn import utils from neutron.services.portforwarding.constants import PORT_FORWARDING_PREFIX +from oslo_log import log + +LOG = log.getLogger(__name__) + RESOURCE_TYPE_MAP = { ovn_const.TYPE_NETWORKS: 'Logical_Switch', ovn_const.TYPE_PORTS: 'Logical_Switch_Port', @@ -82,6 +86,11 @@ def _add_gateway_chassis(api, txn, lrp_name, val): gwc.name = gwc_name gwc.chassis_name = chassis gwc.priority = prio + LOG.info( + "Schedule LRP %(lrp)s on gateway %(gtw)s with priority" + " %(prio)s", + {"lrp": lrp_name, "gtw": chassis, "prio": prio}, + ) prio = prio - 1 uuid_list.append(gwc.uuid) return 'gateway_chassis', uuid_list