Finally let L3 and DHCP agents cleanup namespaces by default

There has been a problem with iproute package that resulted in errors
when deleting the namespaces, so deleting was turned off by default.
According to tests with iproute version 3.12.0 there is no such issue
so the option could be safely turned on by default.

DocImpact
Related-Bug: #1052535
Related-Bug: #1402739

Change-Id: I4c831f98fb2462382ef0f9216e265555186b965a
This commit is contained in:
Eugene Nikanorov 2015-04-22 19:45:57 +04:00 committed by enikanorov
parent e9997b1c76
commit 723162501a
8 changed files with 16 additions and 21 deletions

View File

@ -77,13 +77,12 @@
# Use broadcast in DHCP replies
# dhcp_broadcast_reply = False
# dhcp_delete_namespaces, which is false by default, can be set to True if
# namespaces can be deleted cleanly on the host running the dhcp agent.
# Do not enable this until you understand the problem with the Linux iproute
# utility mentioned in https://bugs.launchpad.net/neutron/+bug/1052535 and
# you are sure that your version of iproute does not suffer from the problem.
# If True, namespaces will be deleted when a dhcp server is disabled.
# dhcp_delete_namespaces = False
# dhcp_delete_namespaces, which is True by default, can be set to False if
# namespaces can't be deleted cleanly on the host running the DHCP agent.
# Disable this if you hit the issue in
# https://bugs.launchpad.net/neutron/+bug/1052535 or if
# you are sure that your version of iproute suffers from the problem.
# dhcp_delete_namespaces = True
# Timeout for ovs-vsctl commands.
# If the timeout expires, ovs commands will fail with ALARMCLOCK error.

View File

@ -85,13 +85,13 @@
# Iptables mangle mark used to mark ingress from external network
# external_ingress_mark = 0x2
# router_delete_namespaces, which is false by default, can be set to True if
# namespaces can be deleted cleanly on the host running the L3 agent.
# Do not enable this until you understand the problem with the Linux iproute
# utility mentioned in https://bugs.launchpad.net/neutron/+bug/1052535 and
# you are sure that your version of iproute does not suffer from the problem.
# router_delete_namespaces, which is True by default, can be set to False if
# namespaces can't be deleted cleanly on the host running the L3 agent.
# Disable this if you hit the issue in
# https://bugs.launchpad.net/neutron/+bug/1052535 or if
# you are sure that your version of iproute suffers from the problem.
# If True, namespaces will be deleted when a router is destroyed.
# router_delete_namespaces = False
# router_delete_namespaces = True
# Timeout for ovs-vsctl commands.
# If the timeout expires, ovs commands will fail with ALARMCLOCK error.

View File

@ -49,7 +49,7 @@ DNSMASQ_OPTS = [
help=_('Comma-separated list of the DNS servers which will be '
'used as forwarders.'),
deprecated_name='dnsmasq_dns_server'),
cfg.BoolOpt('dhcp_delete_namespaces', default=False,
cfg.BoolOpt('dhcp_delete_namespaces', default=True,
help=_("Delete namespace after removing a dhcp server.")),
cfg.IntOpt(
'dnsmasq_lease_max',

View File

@ -76,7 +76,7 @@ OPTS = [
"to the network and not through this parameter. ")),
cfg.BoolOpt('enable_metadata_proxy', default=True,
help=_("Allow running metadata proxy.")),
cfg.BoolOpt('router_delete_namespaces', default=False,
cfg.BoolOpt('router_delete_namespaces', default=True,
help=_("Delete namespace after removing a router.")),
cfg.StrOpt('metadata_access_mark',
default='0x1',

View File

@ -204,7 +204,6 @@ class L3ConfigFixture(ConfigFixture):
'OVSInterfaceDriver'),
'ovs_integration_bridge': integration_bridge,
'external_network_bridge': self._generate_external_bridge(),
'router_delete_namespaces': 'True',
'debug': 'True',
'verbose': 'True',
}

1
neutron/tests/functional/agent/test_l3_agent.py Executable file → Normal file
View File

@ -83,7 +83,6 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
conf.set_override(
'interface_driver',
'neutron.agent.linux.interface.OVSInterfaceDriver')
conf.set_override('router_delete_namespaces', True)
br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
br_ex = self.useFixture(net_helpers.OVSBridgeFixture()).bridge

View File

@ -1941,6 +1941,7 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
self.mock_ip.del_veth.assert_called_once_with('rfp-aaaa')
def test_destroy_router_namespace_skips_ns_removal(self):
self.conf.set_override('router_delete_namespaces', False)
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
ns = namespaces.Namespace(
'qrouter-bar', self.conf, agent.driver, agent.use_ipv6)
@ -1949,7 +1950,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
self.assertEqual(self.mock_ip.netns.delete.call_count, 0)
def test_destroy_router_namespace_removes_ns(self):
self.conf.set_override('router_delete_namespaces', True)
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
ns = namespaces.Namespace(
'qrouter-bar', self.conf, agent.driver, agent.use_ipv6)
@ -2149,7 +2149,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
other_namespaces,
mock_snat_ns,
mock_router_ns):
self.conf.set_override('router_delete_namespaces', True)
good_namespace_list = [namespaces.NS_PREFIX + r['id']
for r in router_list]
@ -2281,7 +2280,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
def _test_external_gateway_removed_ext_gw_port_and_fip(self, fip_ns=False):
self.conf.set_override('state_path', '/tmp')
self.conf.set_override('router_delete_namespaces', True)
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
agent.conf.agent_mode = 'dvr_snat'

View File

@ -742,6 +742,7 @@ class TestDhcpLocalProcess(TestBase):
self._assert_disabled(lp)
def test_disable(self):
self.conf.set_override('dhcp_delete_namespaces', False)
attrs_to_mock = dict([(a, mock.DEFAULT) for a in
['active', 'interface_name']])
network = FakeDualNetwork()
@ -760,7 +761,6 @@ class TestDhcpLocalProcess(TestBase):
self.assertEqual(ip.return_value.netns.delete.call_count, 0)
def test_disable_delete_ns(self):
self.conf.set_override('dhcp_delete_namespaces', True)
attrs_to_mock = {'active': mock.DEFAULT}
with mock.patch.multiple(LocalChild, **attrs_to_mock) as mocks: