Remove advertise_mtu config option

It was deprecated in Newton timeframe. Now we just clean it up from the
tree.

DocImpact: Any advertise_mtu option notions in documentation should be
removed.

UpgradeImpact: After upgrade, all DHCPv4 subnets will see the MTU option
served via corresponding DHCPv4 option. Also, all IPv6 subnets connected
to routers will see MTU set in Router Advertisement messages.

NeutronLibImpact: This patch will break any 3party plugins that directly
access the configuration option.

Change-Id: I31e15018fe764de0fe4d6de7da3c1d9f2cc1d532
This commit is contained in:
Ihar Hrachyshka 2016-12-16 22:40:50 +00:00 committed by Armando Migliaccio
parent 2abd34adb5
commit b09a380f95
7 changed files with 14 additions and 27 deletions

View File

@ -24,7 +24,6 @@ import netaddr
from neutron_lib import constants
from neutron_lib import exceptions
from neutron_lib.utils import file as file_utils
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
from oslo_utils import excutils
@ -389,11 +388,10 @@ class Dnsmasq(DhcpLocalProcess):
cidr.prefixlen, lease))
possible_leases += cidr.size
if cfg.CONF.advertise_mtu:
mtu = getattr(self.network, 'mtu', 0)
# Do not advertise unknown mtu
if mtu > 0:
cmd.append('--dhcp-option-force=option:mtu,%d' % mtu)
mtu = getattr(self.network, 'mtu', 0)
# Do not advertise unknown mtu
if mtu > 0:
cmd.append('--dhcp-option-force=option:mtu,%d' % mtu)
# Cap the limit because creating lots of subnets can inflate
# this possible lease cap.

View File

@ -106,7 +106,6 @@ class DaemonMonitor(object):
'radvd.conf',
True)
buf = six.StringIO()
network_mtu = 0
for p in router_ports:
subnets = p.get('subnets', [])
v6_subnets = [subnet for subnet in subnets if
@ -124,8 +123,7 @@ class DaemonMonitor(object):
subnet['ipv6_ra_mode'] == constants.IPV6_SLAAC]
dns_servers = list(iter_chain(*[subnet['dns_nameservers'] for
subnet in slaac_subnets if subnet.get('dns_nameservers')]))
if self._agent_conf.advertise_mtu:
network_mtu = p.get('mtu', 0)
network_mtu = p.get('mtu', 0)
buf.write('%s' % CONFIG_TEMPLATE.render(
ra_modes=list(ra_modes),

View File

@ -110,11 +110,6 @@ core_opts = [
cfg.IntOpt('send_events_interval', default=2,
help=_('Number of seconds between sending events to nova if '
'there are any events to send.')),
cfg.BoolOpt('advertise_mtu', default=True,
deprecated_for_removal=True,
help=_('If True, advertise network MTU values if core plugin '
'calculates them. MTU is advertised to running '
'instances via DHCP and RA MTU options.')),
cfg.StrOpt('ipam_driver', default='internal',
help=_("Neutron IPAM (IP address management) driver to use. "
"By default, the reference implementation of the "

View File

@ -2399,13 +2399,8 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
ipv6_subnet_modes,
None,
network_mtu)
# Verify that MTU is advertised
expected = "AdvLinkMTU 1446"
ri.agent_conf.set_override('advertise_mtu', False)
ri.radvd._generate_radvd_conf(router[lib_constants.INTERFACE_KEY])
self.assertNotIn(expected, self.utils_replace_file.call_args[0][1])
# Verify that MTU is advertised when advertise_mtu is True
ri.agent_conf.set_override('advertise_mtu', True)
ri.radvd._generate_radvd_conf(router[lib_constants.INTERFACE_KEY])
self.assertIn(expected, self.utils_replace_file.call_args[0][1])

View File

@ -1127,10 +1127,9 @@ class TestDnsmasq(TestBase):
lease_duration, seconds)])
possible_leases += netaddr.IPNetwork(s.cidr).size
if cfg.CONF.advertise_mtu:
if hasattr(network, 'mtu'):
expected.append(
'--dhcp-option-force=option:mtu,%s' % network.mtu)
if hasattr(network, 'mtu'):
expected.append(
'--dhcp-option-force=option:mtu,%s' % network.mtu)
expected.append('--dhcp-lease-max=%d' % min(
possible_leases, max_leases))
@ -1255,14 +1254,12 @@ class TestDnsmasq(TestBase):
'--dhcp-broadcast'])
def test_spawn_cfg_advertise_mtu(self):
cfg.CONF.set_override('advertise_mtu', True)
network = FakeV4Network()
network.mtu = 1500
self._test_spawn(['--conf-file=', '--domain=openstacklocal'],
network)
def test_spawn_cfg_advertise_mtu_plugin_doesnt_pass_mtu_value(self):
cfg.CONF.set_override('advertise_mtu', True)
network = FakeV4Network()
self._test_spawn(['--conf-file=', '--domain=openstacklocal'],
network)

View File

@ -485,7 +485,6 @@ class TestMl2NetworksWithVlanTransparencyAndMTU(
return_value=True):
config.cfg.CONF.set_override('path_mtu', 1000, group='ml2')
config.cfg.CONF.set_override('global_physnet_mtu', 1000)
config.cfg.CONF.set_override('advertise_mtu', True)
network_req = self.new_create_request('networks', self.data)
res = network_req.get_response(self.api)
self.assertEqual(201, res.status_int)

View File

@ -0,0 +1,5 @@
---
upgrade:
- The ``advertise_mtu`` option is removed. Now Neutron always uses all
available means to advertise MTUs to instances (including DHCPv4 and IPv6
RA).