dvr: can't migrate legacy router to DVR

Bug #1619312 reported by John Schwarz on 2016-09-01
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
High
Brian Haley

Bug Description

As the title say:

2016-09-01 16:38:46.026 ERROR neutron.api.v2.resource [req-d738cdb2-01bb-41a7-a2a9-534bf8b06377 admin 85a2b05da4be46b19bc5f7cf41055e45] update failed: No details.
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource Traceback (most recent call last):
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/api/v2/resource.py", line 79, in resource
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource result = method(request=request, **args)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/api/v2/base.py", line 575, in update
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource return self._update(request, id, body, **kwargs)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/oslo_db/api.py", line 151, in wrapper
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource ectxt.value = e.inner_exc
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource self.force_reraise()
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/oslo_db/api.py", line 139, in wrapper
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/api.py", line 82, in wrapped
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource traceback.format_exc())
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource self.force_reraise()
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/api.py", line 77, in wrapped
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/api/v2/base.py", line 623, in _update
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource obj = obj_updater(request.context, id, **kwargs)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/extraroute_db.py", line 76, in update_router
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource context, id, router)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/l3_db.py", line 1722, in update_router
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource id, router)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/l3_db.py", line 282, in update_router
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource router_db = self._update_router_db(context, id, r)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/l3_hamode_db.py", line 533, in _update_router_db
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource context, router_id, data)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/l3_dvr_db.py", line 143, in _update_router_db
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource context.elevated(), router_db):
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/l3_dvr_db.py", line 829, in _create_snat_intf_ports_if_not_exists
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource intf['fixed_ips'][0]['subnet_id'], do_pop=False)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/db/l3_dvr_db.py", line 782, in _add_csnat_router_interface_port
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource {'port': port_data})
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/plugins/common/utils.py", line 197, in create_port
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource return core_plugin.create_port(context, {'port': port_data})
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource File "/opt/openstack/neutron/neutron/common/utils.py", line 617, in inner
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource "transaction.") % f)
2016-09-01 16:38:46.026 TRACE neutron.api.v2.resource RuntimeError: Method <function create_port at 0x7ff66e6cc8c0> cannot be called within a transaction.

This was done on master.

Assaf Muller (amuller) wrote :

This is important for deployments that want to migrate from a centralized routing model to a distributed one. John confirmed on IRC that the router had an admin_state of False before attempting the update to distributed.

Changed in neutron:
status: New → Confirmed
importance: Undecided → High
Changed in neutron:
assignee: nobody → Brian Haley (brian-haley)
Assaf Muller (amuller) on 2016-09-13
Changed in neutron:
milestone: none → newton-rc1

This is a regression caused by [1]. We should follow a similar fix to other L3 operations or disentangle the mess altogether.

[1] https://review.openstack.org/#/q/topic:bug/1540844

Changed in neutron:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/370430
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=25e65df7974c238517ab51ea07079ab0482ad44a
Submitter: Jenkins
Branch: master

commit 25e65df7974c238517ab51ea07079ab0482ad44a
Author: Brian Haley <email address hidden>
Date: Wed Sep 14 16:52:07 2016 -0400

    Fix migration of legacy router to DVR

    We have to ensure ML2's create_port method is not called
    in a transaction.

    This adds a temporary hack to set an attribute on the context
    to skip this check to accomodate an L3 code-path that has a port
    creation entangled in a transaction. This attribute will
    ultimately be removed once this path is refactored.

    Change-Id: I9c41a7848b22c437bedcdd7eb57f7c9da873b06d
    Closes-bug: #1619312

Changed in neutron:
status: In Progress → Fix Released

This issue was fixed in the openstack/neutron 9.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers