When metadata is enabled, l3 agent db loop raises at each iteration

Bug #1045312 reported by Salvatore Orlando
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Salvatore Orlando

Bug Description

An incorrect statement is executed when setting up floating ips for a router:

            rules.append('PREROUTING', '-s 0.0.0.0/0 -d 169.254.169.254/32 '
                         '-p tcp -m tcp --dport 80 -j DNAT '
                         '--to-destination %s:%s' %
                         (self.conf.metadata_ip, self.conf.metadata_port))

The arguments for the rule should be passed as a tuple. Thanks Gary for spotting this.
As a result, the external gateway port is never updated in self.router_info, causing external_gateway_added to be invoked at each iteration. This will cause the error visible on the console, concerning the inability of adding again the default route:

Command: ['sudo', 'ip', 'netns', 'exec', 'qrouter-9eccafc4-0258-4fd1-91ec-c0dcbb7f2402', 'route', 'add', 'default', 'gw', '172.24.4.225']
Exit code: 7
Stdout: ''
Stderr: 'SIOCADDRT: File exists\n'
2012-09-03 13:58:58 ERROR [quantum.agent.l3_agent] Error running l3_nat daemon_loop
Traceback (most recent call last):
  File "/opt/stack/quantum/quantum/agent/l3_agent.py", line 167, in daemon_loop
    self.do_single_loop()
  File "/opt/stack/quantum/quantum/agent/l3_agent.py", line 212, in do_single_loop
    self.process_router(ri)
  File "/opt/stack/quantum/quantum/agent/l3_agent.py", line 264, in process_router
    self.external_gateway_added(ri, ex_gw_port, internal_cidrs)
  File "/opt/stack/quantum/quantum/agent/l3_agent.py", line 351, in external_gateway_added
    ip_wrapper.netns.execute(cmd)
  File "/opt/stack/quantum/quantum/agent/linux/ip_lib.py", line 332, in execute
    root_helper=self._parent.root_helper)
  File "/opt/stack/quantum/quantum/agent/linux/utils.py", line 55, in execute
    raise RuntimeError(m)
RuntimeError:
Command: ['sudo', 'ip', 'netns', 'exec', 'qrouter-9eccafc4-0258-4fd1-91ec-c0dcbb7f2402', 'route', 'add', 'default', 'gw', '172.24.4.225']
Exit code: 7
Stdout: ''
Stderr: 'SIOCADDRT: File exists\n'

Another side effect is that external_gateway_removed is never invoked.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

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

Changed in quantum:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/12316
Committed: http://github.com/openstack/quantum/commit/6beb9e079b00b010c2ba756882c619d3c5159e24
Submitter: Jenkins
Branch: master

commit 6beb9e079b00b010c2ba756882c619d3c5159e24
Author: Salvatore Orlando <email address hidden>
Date: Mon Sep 3 05:43:29 2012 -0700

    Fix error in rule for metadata server dnat

    Fixes bug 1045312

    Change-Id: Ie0e2aa7e638a7cd50c87ae6d4fa807cb7733c3d1

Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: folsom-rc1 → 2012.2
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.