From 806d96cbbe45fcd473935e777a2a56037fbb9d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awek=20Kap=C5=82o=C5=84ski?= Date: Fri, 13 Apr 2018 11:34:42 +0200 Subject: [PATCH] Override ovsdb_timeout default value in ovs_cleanup tool In case when there is a lot of ports to clean in bridge, default ovsdb_timeout which is set for 10 seconds is not enough. This patch overrides default 10 seconds timeout in neutron-ovs-cleanup tool to 600 seconds. 600 seconds value was tested experimentally on my dev environment for at least 10000 ports in bridge. In case when user will have more ports to delete with this script, it will be required to increase this ovsdb_timeout value in configuration. Change-Id: I79a554acdb1d6d61903be0c42d0215d302884e93 Closes-Bug: #1763604 --- neutron/cmd/ovs_cleanup.py | 5 +++++ ...ide_for_ovs_cleanup_tool-e6ed6db258d0819e.yaml | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 releasenotes/notes/ovsdb_timeout_override_for_ovs_cleanup_tool-e6ed6db258d0819e.yaml diff --git a/neutron/cmd/ovs_cleanup.py b/neutron/cmd/ovs_cleanup.py index 74723718222..98c3b9fa731 100644 --- a/neutron/cmd/ovs_cleanup.py +++ b/neutron/cmd/ovs_cleanup.py @@ -26,6 +26,10 @@ from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants LOG = logging.getLogger(__name__) +# Default ovsdb_timeout value for this script. +# It allows to clean bridges with even thousands of ports. +CLEANUP_OVSDB_TIMEOUT = 600 + def setup_conf(): """Setup the cfg for the clean up utility. @@ -39,6 +43,7 @@ def setup_conf(): l3_config.register_l3_agent_config_opts(l3_config.OPTS, conf) agent_config.register_interface_driver_opts_helper(conf) agent_config.register_interface_opts() + conf.set_default("ovsdb_timeout", CLEANUP_OVSDB_TIMEOUT, "OVS") return conf diff --git a/releasenotes/notes/ovsdb_timeout_override_for_ovs_cleanup_tool-e6ed6db258d0819e.yaml b/releasenotes/notes/ovsdb_timeout_override_for_ovs_cleanup_tool-e6ed6db258d0819e.yaml new file mode 100644 index 00000000000..5cc762c0a6e --- /dev/null +++ b/releasenotes/notes/ovsdb_timeout_override_for_ovs_cleanup_tool-e6ed6db258d0819e.yaml @@ -0,0 +1,15 @@ +--- +fixes: + - | + Fixes bug `1763604 `_. + Override default value of ``ovsdb_timeout`` config option in + ``neutron-ovs-cleanup`` script. + The default value is 10 seconds, but that is not enough for the + ``neutron-ovs-cleanup`` script when there are many ports to remove from + a single bridge, for example, 5000. Because of that, we now override the + default value for the config option to be 600 seconds (10 minutes). +issues: + - | + In the case when the number of ports to clean up in a single bridge is + larger than about 10000, it might require an increase in the + ``ovsdb_timeout`` config option to some value higher than 600 seconds.