Neutron-metering-agent failed to get traffic counters after a router moving from one l3-agent to another

Bug #1521996 reported by Sergey Belous
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Confirmed
Low
Sergey Belous
9.x
Won't Fix
Low
Sergey Belous

Bug Description

MOS 8.0 env, 1 compute, 3 controllers.

Step to reproduce:
1. Create internal net, subnet, router. Set external gateway for router, add interface to router for created net.
2. Create neutron-meter-label
3. Remove a router from a L3 agent from one controller and add a router to a L3 agent on another controller

After that we can see traces in neutron-meter-agent logs:
2015-12-02 11:02:42.607 26244 DEBUG neutron.agent.linux.utils [-] Running command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'exec', 'qrouter-27e416a2-c7fd-4e75-9d94-e6d4c77390ac', 'iptables', '-t', 'filter', '-L', 'neutron-meter-l-b25329ed-e71', '-n', '-v', '-x', '-Z'] create_process /usr/lib/python2.7/dist-packages/neutron/agent/linux/utils.py:85
2015-12-02 11:02:43.334 26244 ERROR neutron.agent.linux.utils [-]
Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'exec', 'qrouter-27e416a2-c7fd-4e75-9d94-e6d4c77390ac', 'iptables', '-t', 'filter', '-L', 'neutron-meter-l-b25329ed-e71', '-n', '-v', '-x', '-Z']
Exit code: 1
Stdin:
Stdout:
Stderr: iptables: No chain/target/match by that name.

2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver [-] Failed to get traffic counters, router: {u'status': u'ACTIVE', u'name': u'router02', u'gw_port_id': u'339e7c19-48ab-4898-ba18-54f6b5ba2c2d', u'admin_state_up': True, u'tenant_id': u'fcab0b76df20485193be7853a28ee929', u'_metering_labels': [{u'rules': [], u'id': u'af03d219-c236-4199-9057-f2f58770db58'}], u'id': u'27e416a2-c7fd-4e75-9d94-e6d4c77390ac'}
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver Traceback (most recent call last):
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver File "/usr/lib/python2.7/dist-packages/neutron/services/metering/drivers/iptables/iptables_driver.py", line 354, in get_traffic_counters
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver chain, wrap=False, zero=True)
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver File "/usr/lib/python2.7/dist-packages/neutron/agent/linux/iptables_manager.py", line 720, in get_traffic_counters
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver current_table = self.execute(args, run_as_root=True)
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver File "/usr/lib/python2.7/dist-packages/neutron/agent/linux/utils.py", line 159, in execute
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver raise RuntimeError(m)
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver RuntimeError:
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ip', 'netns', 'exec', 'qrouter-27e416a2-c7fd-4e75-9d94-e6d4c77390ac', 'iptables', '-t', 'filter', '-L', 'neutron-meter-l-b25329ed-e71', '-n', '-v', '-x', '-Z']
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver Exit code: 1
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver Stdin:
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver Stdout:
2015-12-02 11:02:43.343 26244 ERROR neutron.services.metering.drivers.iptables.iptables_driver Stderr: iptables: No chain/target/match by that name.

The problem is, that in router's namespace on new controller there are not any rules in iptables, that was created on router's namespace on previous controller by neutron-metering-agent. And neutron-metering-agent not handle it.

Sergey Belous (sbelous)
summary: Neutron-metering-agent failed to get traffic counters after a router
- moving from one controller to another
+ moving from one l3-agent to another
Changed in mos:
importance: Undecided → Medium
status: New → Confirmed
Sergey Belous (sbelous)
Changed in mos:
milestone: 8.0 → 9.0
tags: added: area-neutron
Changed in mos:
importance: Medium → Low
Revision history for this message
Bug Checker Bot (bug-checker) wrote : Autochecker

(This check performed automatically)
Please, make sure that bug description contains the following sections filled in with the appropriate data related to the bug you are describing:

actual result

expected result

steps to reproduce

For more detailed information on the contents of each of the listed sections see https://wiki.openstack.org/wiki/Fuel/How_to_contribute#Here_is_how_you_file_a_bug

tags: added: need-info
Revision history for this message
Alexander Ignatov (aignatov) wrote :

Low bug is moving to next release.

Changed in mos:
milestone: 9.0 → 10.0
tags: added: move-to-10.0
Revision history for this message
Sergey Belous (sbelous) wrote :
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.