neutron-netns-cleanup script doesn't work in icehouse/havana, code is broken

Bug #1291915 reported by Miguel Angel Ajo
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Miguel Angel Ajo

Bug Description

1st) Some configuration options are not registered on the tool, but they're used in neutron.agent.linux.dhcp during execution

$ neutron-netns-cleanup --debug --force --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
2014-03-12 14:55:44.791 INFO neutron.common.config [-] Logging enabled!
2014-03-12 14:55:44.792 DEBUG neutron.agent.linux.utils [-] Running command: ['sudo', '/usr/bin/neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'list'] from (pid=1785) create_process /opt/stack/neutron/neutron/agent/linux/utils.py:48
2014-03-12 14:55:45.001 DEBUG neutron.agent.linux.utils [-]
Command: ['sudo', '/usr/bin/neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'list']
Exit code: 0
Stdout: 'qdhcp-65cb66de-82d0-407c-aa23-2c544528f0d2\nqrouter-acc5f724-a169-4ffc-9e81-f00d43954509\nqrouter-5ed23337-9538-4994-823f-c64720506e54\n'
Stderr: '' from (pid=1785) execute /opt/stack/neutron/neutron/agent/linux/utils.py:74
2014-03-12 14:55:47.006 ERROR neutron.agent.linux.dhcp [-] Error importing interface driver 'neutron.agent.linux.interface.OVSInterfaceDriver': no such option: ovs_use_veth
Error importing interface driver 'neutron.agent.linux.interface.OVSInterfaceDriver': no such option: ovs_use_veth

2nd) When we try to destroy a network, there's a dependency on the .namespace attribute of the network, that wasn't before.

Stderr: '' from (pid=1969) execute /opt/stack/neutron/neutron/agent/linux/utils.py:74
2014-03-12 15:08:53.048 ERROR neutron.agent.netns_cleanup_util [-] Error unable to destroy namespace: qdhcp-65cb66de-82d0-407c-aa23-2c544528f0d2
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util Traceback (most recent call last):
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util File "/opt/stack/neutron/neutron/agent/netns_cleanup_util.py", line 131, in destroy_namespace
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util kill_dhcp(conf, namespace)
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util File "/opt/stack/neutron/neutron/agent/netns_cleanup_util.py", line 86, in kill_dhcp
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util dhcp_driver.disable()
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 181, in disable
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util self.device_manager.destroy(self.network, self.interface_name)
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 814, in destroy
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util self.driver.unplug(device_name, namespace=network.namespace)
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util AttributeError: 'FakeNetwork' object has no attribute 'namespace'
2014-03-12 15:08:53.048 TRACE neutron.agent.netns_cleanup_util

3rd) This error will happen because no plugin rpc connection is provided,
and that's used in /opt/stack/neutron/neutron/agent/linux/dhcp.py as self.plugin.release_dhcp_port

2014-03-13 12:00:07.880 ERROR neutron.agent.netns_cleanup_util [-] Error unable to destroy namespace: qdhcp-388a37af-556d-4f4c-98b4-0ba41f944e32
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util Traceback (most recent call last):
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util File "/opt/stack/neutron/neutron/agent/netns_cleanup_util.py", line 132, in destroy_namespace
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util kill_dhcp(conf, namespace)
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util File "/opt/stack/neutron/neutron/agent/netns_cleanup_util.py", line 87, in kill_dhcp
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util dhcp_driver.disable()
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 181, in disable
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util self.device_manager.destroy(self.network, self.interface_name)
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 816, in destroy
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util self.plugin.release_dhcp_port(network.id,
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util AttributeError: 'NoneType' object has no attribute 'release_dhcp_port'
2014-03-13 12:00:07.880 TRACE neutron.agent.netns_cleanup_util

Tags: l3-ipam-dhcp
Changed in neutron:
assignee: nobody → Miguel Angel Ajo (mangelajo)
description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/80261

Changed in neutron:
status: New → In Progress
Changed in neutron:
status: In Progress → Confirmed
Changed in neutron:
status: Confirmed → In Progress
Kyle Mestery (mestery)
Changed in neutron:
importance: Undecided → High
Changed in neutron:
milestone: none → icehouse-rc2
tags: added: l3-ipam-dhcp
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/80261
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=907bf41afbdb9f565c45a535f637c8928d0be52a
Submitter: Jenkins
Branch: master

commit 907bf41afbdb9f565c45a535f637c8928d0be52a
Author: Miguel Angel Ajo <email address hidden>
Date: Tue Mar 18 13:33:19 2014 +0100

    fixes broken neutron-netns-cleanup

    Some configuration parameters used in neutron.agent.linux.utils
    were missing. The namespace attribute in the FakeNetwork object
    was missing, and used in neutron.agent.linux.dhcp. Also, the
    plugin object was missing for release_dhcp_port operation.

    We provide a fake plugin object to accept current and any future
    plugin calls as this is meant to be an standalone tool that
    should work without any RPC connectivity.

    FakeNetwork was switched for neutron.agent.linux.dhcp.NetModel
    to follow any future changes in NetModel.

    Two wrong called_once_with_args calls without assert were fixed.

    Change-Id: Ia51ea9bd4c8eea6b250858964ad5286c933702e0
    Closes-Bug: #1291915
    Partial-Bug: #1297875

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
milestone: icehouse-rc2 → juno-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/85503

Changed in neutron:
milestone: juno-1 → icehouse-rc2
no longer affects: neutron/icehouse
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (milestone-proposed)

Reviewed: https://review.openstack.org/85503
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5417220fc50fb31218ed1ed2aba6b926591c5f81
Submitter: Jenkins
Branch: milestone-proposed

commit 5417220fc50fb31218ed1ed2aba6b926591c5f81
Author: Miguel Angel Ajo <email address hidden>
Date: Tue Mar 18 13:33:19 2014 +0100

    fixes broken neutron-netns-cleanup

    Some configuration parameters used in neutron.agent.linux.utils
    were missing. The namespace attribute in the FakeNetwork object
    was missing, and used in neutron.agent.linux.dhcp. Also, the
    plugin object was missing for release_dhcp_port operation.

    We provide a fake plugin object to accept current and any future
    plugin calls as this is meant to be an standalone tool that
    should work without any RPC connectivity.

    FakeNetwork was switched for neutron.agent.linux.dhcp.NetModel
    to follow any future changes in NetModel.

    Two wrong called_once_with_args calls without assert were fixed.

    Change-Id: Ia51ea9bd4c8eea6b250858964ad5286c933702e0
    Closes-Bug: #1291915
    Partial-Bug: #1297875
    (cherry picked from commit 907bf41afbdb9f565c45a535f637c8928d0be52a)

Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-rc2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.