Network cache not correctly updated during "interface-attach"

Bug #1223859 reported by Cyril Roelandt on 2013-09-11
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
High
Aaron Rosen
Havana
High
Solly Ross

Bug Description

The network cache is not correctly updated when running "nova interface-attach": only the latest allocated IP is used. See this log:

http://paste.openstack.org/show/46643/

Nevermind the error reported when running "nova interface-attach": I believe it is an unrelated issue, and I'll write another bug report for it.

I noticed this issue a few months ago, but haven't had time to work on it. I'll try and submit a patch ASAP. See my analysis of the issue here: https://bugs.launchpad.net/nova/+bug/1197192/comments/3

Changed in nova:
assignee: nobody → Cyril Roelandt (cyril-roelandt)
tags: added: network

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

Changed in nova:
status: New → In Progress
Raid (raid-chan) wrote :

I have same problem in version Grizzly 2013.1.3, this bug is also impact interface-detach. The old interface can't be deleted after attached new interface.

Error in log:

2013-10-14 11:32:41.621 ERROR nova.openstack.common.rpc.amqp [req-a7d5449c-482a-43c2-bc7c-49c7877ad3a5 5191001b9c2a4021a3eb9658067e0018 06a9bfcdbf7940158972942179a852b9] Exception during message handling
2013-10-14 11:32:41.621 11476 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2013-10-14 11:32:41.621 11476 TRACE nova.openstack.common.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py", line 430, in _process_data
2013-10-14 11:32:41.621 11476 TRACE nova.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2013-10-14 11:32:41.621 11476 TRACE nova.openstack.common.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py", line 133, in dispatch
2013-10-14 11:32:41.621 11476 TRACE nova.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2013-10-14 11:32:41.621 11476 TRACE nova.openstack.common.rpc.amqp File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 3069, in detach_interface
2013-10-14 11:32:41.621 11476 TRACE nova.openstack.common.rpc.amqp "attached") % locals())
2013-10-14 11:32:41.621 11476 TRACE nova.openstack.common.rpc.amqp PortNotFound: Port a80e2a48-aa4b-45c9-93bc-dc22374aeefb is not attached

Dan Smith (danms) on 2013-10-25
Changed in nova:
importance: Undecided → High
milestone: none → icehouse-1
tags: added: havana-backport-potential
Aaron Rosen (arosen) on 2013-10-25
Changed in nova:
assignee: Cyril Roelandt (cyril-roelandt) → Aaron Rosen (arosen)

Reviewed: https://review.openstack.org/53969
Committed: http://github.com/openstack/nova/commit/1957339df302e2da75e0dbe78b5d566194ab2c08
Submitter: Jenkins
Branch: master

commit 1957339df302e2da75e0dbe78b5d566194ab2c08
Author: Aaron Rosen <email address hidden>
Date: Fri Oct 25 15:32:01 2013 -0700

    Fix interface-attach removes existing interfaces from db

    The following commit 394c693e359ed4f19cc2f7d975b1f9ee5500b7f6 changed
    allocate_port_for_instance() to only return the ports that were created
    rather than all of the ports on the instance which broke the attach-interface
    code.

    This patch fixes this issue by remove the sync decorators from:
    allocate_for_instance, allocate_port_for_instance, and
    deallocate_port_for_instance to just _build_instance_nw_info which
    is called in all these cases instead.

    Closes-bug: #1223859

    Change-Id: I66eb0c0ab926e0a8d1e2c9cfe1f7fd579ea3aa27

Changed in nova:
status: In Progress → Fix Committed

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/58545

Thierry Carrez (ttx) on 2013-12-04
Changed in nova:
status: Fix Committed → Fix Released
Euler Jiang (euler-jiang) wrote :

Hi, I apply the patch https://review.openstack.org/#/c/58545/ on my Havana installation. It works.

But it notice a small problem, not sure whether it is a problem or not.

I attach an interface, then run 'nova list', the previous IP show twice: privateNet=10.0.0.8, 10.0.0.7, 10.0.0.8. And few seconds, I run "nova list" again, it is back to be normal "privateNet=10.0.0.7, 10.0.0.8".

See below:

[root@ecloud1-controller site-packages(keystone_demo)]# nova interface-attach --net-id 9d9f9b8f-f887-48d1-b86c-530cc501023d --fixed-ip 10.0.0.7 testvm1

[root@ecloud1-controller site-packages(keystone_demo)]# nova list
+--------------------------------------+---------+--------+------------+-------------+-----------------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+---------+--------+------------+-------------+-----------------------------------------+
| 47250f7f-e499-4982-bfa5-f6f632105408 | testvm | ACTIVE | None | Running | privateNet=10.0.0.4 |
| 9f6ab492-1ae2-4d36-b10d-b3f16e6ecbb0 | testvm1 | ACTIVE | None | Running | privateNet=10.0.0.8, 10.0.0.7, 10.0.0.8 |
+--------------------------------------+---------+--------+------------+-------------+-----------------------------------------+
[root@ecloud1-controller site-packages(keystone_demo)]# nova list
+--------------------------------------+---------+--------+------------+-------------+-------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+---------+--------+------------+-------------+-------------------------------+
| 47250f7f-e499-4982-bfa5-f6f632105408 | testvm | ACTIVE | None | Running | privateNet=10.0.0.4 |
| 9f6ab492-1ae2-4d36-b10d-b3f16e6ecbb0 | testvm1 | ACTIVE | None | Running | privateNet=10.0.0.7, 10.0.0.8 |
+--------------------------------------+---------+--------+------------+-------------+-------------------------------+

Thanks!

Alan Pevec (apevec) on 2013-12-08
tags: removed: havana-backport-potential
Thierry Carrez (ttx) on 2014-04-17
Changed in nova:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers