From d9e4d20da86f29f7ebdb3c6b07086924888edd39 Mon Sep 17 00:00:00 2001 From: "Sean M. Collins" Date: Fri, 8 Jan 2016 13:32:14 -0800 Subject: [PATCH] Make advertisement intervals for radvd configurable Currently a global setting that is applied for all managed radvd processes. Per-process setting could be done in the future. For large clouds, it may be useful to increase the intervals, to reduce multicast storms. Co-Authored-By: Brian Haley DocImpact Router advertisement intervals for radvd are now configurable Related-Bug: #1532338 Change-Id: I6cc313599f0ee12f7d51d073a22321221fca263f --- neutron/agent/linux/ra.py | 14 +++++++++++--- neutron/tests/unit/agent/l3/test_agent.py | 14 ++++++++++++++ ...ls-for-radvd-configurable-6d85b5fdd97a2742.yaml | 9 +++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/advertisement-intervals-for-radvd-configurable-6d85b5fdd97a2742.yaml diff --git a/neutron/agent/linux/ra.py b/neutron/agent/linux/ra.py index 9cc0a252806..b4c57872ca6 100644 --- a/neutron/agent/linux/ra.py +++ b/neutron/agent/linux/ra.py @@ -38,13 +38,19 @@ OPTS = [ cfg.StrOpt('ra_confs', default='$state_path/ra', help=_('Location to store IPv6 RA config files')), + cfg.IntOpt('min_rtr_adv_interval', + default=3, + help=_('MinRtrAdvInterval setting for radvd.conf')), + cfg.IntOpt('max_rtr_adv_interval', + default=10, + help=_('MaxRtrAdvInterval setting for radvd.conf')), ] CONFIG_TEMPLATE = jinja2.Template("""interface {{ interface_name }} { AdvSendAdvert on; - MinRtrAdvInterval 3; - MaxRtrAdvInterval 10; + MinRtrAdvInterval {{ min_rtr_adv_interval }}; + MaxRtrAdvInterval {{ max_rtr_adv_interval }}; {% if constants.DHCPV6_STATELESS in ra_modes %} AdvOtherConfigFlag on; @@ -106,7 +112,9 @@ class DaemonMonitor(object): interface_name=interface_name, prefixes=auto_config_prefixes, dns_servers=dns_servers[0:MAX_RDNSS_ENTRIES], - constants=constants)) + constants=constants, + min_rtr_adv_interval=self._agent_conf.min_rtr_adv_interval, + max_rtr_adv_interval=self._agent_conf.max_rtr_adv_interval)) common_utils.replace_file(radvd_conf, buf.getvalue()) return radvd_conf diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py index 229114a2156..b1fc42e8b81 100644 --- a/neutron/tests/unit/agent/l3/test_agent.py +++ b/neutron/tests/unit/agent/l3/test_agent.py @@ -2246,6 +2246,20 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework): assertFlag(managed_flag)('AdvManagedFlag on;', self.utils_replace_file.call_args[0][1]) + def test_generate_radvd_intervals(self): + self.conf.set_override('min_rtr_adv_interval', 22) + self.conf.set_override('max_rtr_adv_interval', 66) + router = l3_test_common.prepare_router_data() + ipv6_subnet_modes = [{'ra_mode': l3_constants.IPV6_SLAAC, + 'address_mode': l3_constants.IPV6_SLAAC}] + ri = self._process_router_ipv6_subnet_added(router, + ipv6_subnet_modes) + ri.radvd._generate_radvd_conf(router[l3_constants.INTERFACE_KEY]) + self.assertIn("MinRtrAdvInterval 22", + self.utils_replace_file.call_args[0][1]) + self.assertIn("MaxRtrAdvInterval 66", + self.utils_replace_file.call_args[0][1]) + def test_generate_radvd_rdnss_conf(self): router = l3_test_common.prepare_router_data() ipv6_subnet_modes = [{'ra_mode': l3_constants.IPV6_SLAAC, diff --git a/releasenotes/notes/advertisement-intervals-for-radvd-configurable-6d85b5fdd97a2742.yaml b/releasenotes/notes/advertisement-intervals-for-radvd-configurable-6d85b5fdd97a2742.yaml new file mode 100644 index 00000000000..69916ebb19c --- /dev/null +++ b/releasenotes/notes/advertisement-intervals-for-radvd-configurable-6d85b5fdd97a2742.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - Prior to Mitaka, the settings that control the frequency of + router advertisements transmitted by the radvd daemon were + not able to be adjusted. Larger deployments may wish to decrease + the frequency in which radvd sends multicast traffic. The 'min_rtr_adv_interval' + and 'max_rtr_adv_interval' settings in the L3 agent configuration file + map directly to the 'MinRtrAdvInterval' and 'MaxRtrAdvInterval' in the generated + radvd.conf file. Consult the manpage for radvd.conf for more detailed information.