nova list show incorrect when neutron re-assign floatingip

Bug #1381886 reported by ZongKai LI
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
ZongKai LI
Icehouse
New
Undecided
Unassigned
Juno
Fix Released
Undecided
Unassigned

Bug Description

boot more several instances, create a floatingip, when re-assign the floatingip to multi instances, nova list will show incorrect result.
>>>neutron floatingip-associate floatingip-id instance0-pord-id
>>>neutron floatingip-associate floatingip-id instance1-port-id
>>>neutron floatingip-associate floatingip-id instance2-port-id
>>>nova list
(nova list result will be like:)
--------------------------
instance0 fixedip0, floatingip
instance1 fixedip1, floatingip
instance2 fixedip2, floatingip

instance0,1,2, they all have floatingip, but run "neutron floatingip-list", we can see it only bind to instance2.
another situation is that after a few time(half a min, or longer), "nova list" can show correct result.
---------------------------
instance0 fixedip0
instance1 fixedip1
instance2 fixedip2, floatingip

ZongKai LI (zongkai)
description: updated
Revision history for this message
ZongKai LI (zongkai) wrote :

it's neutron's problem.
the operation in bug description is floating ip re-assignment, this can depart into two steps, disassociate from origin port, associate to new port; when re-assign floating ip, network changes happened on two(origin, new) instance's port, but neutron only send event for new instance port;
add code ensure neutron will first send event for origin/disassociate one, then send event for new/associate one, will fix this.

affects: nova → neutron
Changed in neutron:
assignee: nobody → ZongKai LI (lzklibj)
status: New → Fix Committed
ZongKai LI (zongkai)
Changed in neutron:
status: Fix Committed → In Progress
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/129826

Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/133984

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/133985

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

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

commit add8944d4dba2a69e8f7da47f120d5dc63952f77
Author: lzklibj <email address hidden>
Date: Mon Oct 20 23:55:53 2014 -0700

    fix event_send for re-assign floating ip

    Neutron can associate a floating ip to a new port
    without disassociate from original instance port.
    This situation will send network changed event only
    for new instance port, and that event object contains
    the new instance's id.

    In this case nova will update new instance's info
    but not original one's in nova's database table
    instance_info_caches. For nova can get new instance's
    id from the above event. So in table instance_info_caches,
    both original instance and new instance will have the
    same floating ip in their records. And this make it
    possible that, in most situation, after your re-assign
    floating ip, run "nova list" will return incorrect info,
    multiple instances have a same floating ip, and this may
    confuse users.

    Nova will sync data in table instance_info_caches, but it
    may take dozens of seconds.
    The new added code will send network changed event for the
    original instance, and this will make nova update instance_
    _info_caches table in a few seconds.

    Change-Id: If3ee11535f649fc51bf1a52806008c1c5c0e73b6
    Closes-Bug: 1381886

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/icehouse)

Reviewed: https://review.openstack.org/133985
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=70fb84390d130514b47b5704802c0c3f30739f2c
Submitter: Jenkins
Branch: stable/icehouse

commit 70fb84390d130514b47b5704802c0c3f30739f2c
Author: lzklibj <email address hidden>
Date: Mon Oct 20 23:55:53 2014 -0700

    fix event_send for re-assign floating ip

    Neutron can associate a floating ip to a new port
    without disassociate from original instance port.
    This situation will send network changed event only
    for new instance port, and that event object contains
    the new instance's id.

    In this case nova will update new instance's info
    but not original one's in nova's database table
    instance_info_caches. For nova can get new instance's
    id from the above event. So in table instance_info_caches,
    both original instance and new instance will have the
    same floating ip in their records. And this make it
    possible that, in most situation, after your re-assign
    floating ip, run "nova list" will return incorrect info,
    multiple instances have a same floating ip, and this may
    confuse users.

    Nova will sync data in table instance_info_caches, but it
    may take dozens of seconds.
    The new added code will send network changed event for the
    original instance, and this will make nova update instance_
    _info_caches table in a few seconds.

    Change-Id: If3ee11535f649fc51bf1a52806008c1c5c0e73b6
    Closes-Bug: 1381886
    (cherry picked from commit add8944d4dba2a69e8f7da47f120d5dc63952f77)

tags: added: in-stable-icehouse
tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/juno)

Reviewed: https://review.openstack.org/133984
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c7954abb174b7b6dbd0ccff9397e2521876cb312
Submitter: Jenkins
Branch: stable/juno

commit c7954abb174b7b6dbd0ccff9397e2521876cb312
Author: lzklibj <email address hidden>
Date: Mon Oct 20 23:55:53 2014 -0700

    fix event_send for re-assign floating ip

    Neutron can associate a floating ip to a new port
    without disassociate from original instance port.
    This situation will send network changed event only
    for new instance port, and that event object contains
    the new instance's id.

    In this case nova will update new instance's info
    but not original one's in nova's database table
    instance_info_caches. For nova can get new instance's
    id from the above event. So in table instance_info_caches,
    both original instance and new instance will have the
    same floating ip in their records. And this make it
    possible that, in most situation, after your re-assign
    floating ip, run "nova list" will return incorrect info,
    multiple instances have a same floating ip, and this may
    confuse users.

    Nova will sync data in table instance_info_caches, but it
    may take dozens of seconds.
    The new added code will send network changed event for the
    original instance, and this will make nova update instance_
    _info_caches table in a few seconds.

    Change-Id: If3ee11535f649fc51bf1a52806008c1c5c0e73b6
    Closes-Bug: 1381886
    (cherry picked from commit add8944d4dba2a69e8f7da47f120d5dc63952f77)

Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-1 → 2015.1.0
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.