Neutron refuses to delete instance associated with multiple floating addresses

Bug #1302701 reported by Lars Kellogg-Stedman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Lars Kellogg-Stedman
Icehouse
New
Undecided
Unassigned

Bug Description

Neutron does not permit one to delete an instance that is associated with multiple floating ip addresses.

Create an instance:

  nova boot ... --nic net-id=3ff9b903-e921-4752-a26f-cba8f1433992 --key-name lars test0

Add a second fixed ip address:

  nova add-fixed-ip test0 3ff9b903-e921-4752-a26f-cba8f1433992
  nova show test0 | grep network
  | net0 network | 10.0.0.4, 10.0.0.5 |

Associate a floating ip address with each fixed address:

  $ nova add-floating-ip --fixed-address 10.0.0.5 test0 192.168.200.7
  $ nova add-floating-ip --fixed-address 10.0.0.4 test0 192.168.200.6

Now attempt to delete the instance:

  $ nova delete test0
  $ nova list | grep test0
  | c36e277f-e354-4856-8f5b-9603e6c76b2e | test0 | ERROR ...

Neutron server fails with:

  ERROR neutron.api.v2.resource [-] delete failed
  TRACE neutron.api.v2.resource Traceback (most recent call last):
  TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 84, in resource
  TRACE neutron.api.v2.resource result = method(request=request, **args)
  TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 432, in delete
  TRACE neutron.api.v2.resource obj_deleter(request.context, id, **kwargs)
  TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/plugins/openvswitch/ovs_neutron_plugin.py", line 631, in delete_port
  TRACE neutron.api.v2.resource self.disassociate_floatingips(context, id)
  TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/db/l3_db.py", line 751, in disassociate_floatingips
  TRACE neutron.api.v2.resource % port_id)
  TRACE neutron.api.v2.resource Exception: Multiple floating IPs found for port b591c76b-9d72-41d7-a884-2959a1f6b7fc
  TRACE neutron.api.v2.resource

Disassociating one of the floating ips allows the delete to complete successfully:

  nova floating-ip-disassociate test0 192.168.200.6
  nova delete test0

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/85432

Changed in neutron:
assignee: nobody → Lars Kellogg-Stedman (larsks)
status: New → In Progress
Kyle Mestery (mestery)
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :

The proposed change at https://review.openstack.org/85432 now passes jenkins and includes a unit test.

Revision history for this message
Carl Baldwin (carl-baldwin) wrote :

I tried running through this on one of my instances.

My command to add a fixed ip returned with a successful status code but I could not see that the command had any effect.

1. Neutron port-show does not show any new address
2. Nova show doesn't show any new address
3. My instance doesn't show a second ip address when I log in and look at eth0.

What am I missing?

Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :

Carl:

This is the write-up that eventually led me to this bug. Let me know if this helps you out at all:

https://ask.openstack.org/en/question/26543/put-multiple-network-interfaces-on-same-network-for-multiple-ip-addresses-for-an-instance/#26598

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to neutron (master)

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

commit bad87ce76ad27f2a4b3c72e26e2eccc2c9564b85
Author: Lars Kellogg-Stedman <email address hidden>
Date: Fri Apr 4 13:35:32 2014 -0400

    allow delete_port to work when there are multiple floating ips

    It is possible to associate multiple floating ip addresses with a single
    port through the use of multiple *fixed* ip addresses, e.g.:

        nova boot ... --nic net-id=my-net-id myserver
        nova add-fixed-ip myserver my-net-id
        nova add-floating-ip --fixed-address x.x.x.1 myserver y.y.y.y.1
        nova add-floating-ip --fixed-address x.x.x.2 myserver y.y.y.y.2

    In this situation, neutron.db.l3_db.disassociate_floatingips would throw
    an exception:

        Exception: Multiple floating IPs found for port <port-id>

    This would prevent someone from deleting an instance that was associated
    with multiple floating ips.

    This patch corrects disassociate_floatingips so that it will
    disassociate all floating ips associated with the port, allowing the
    delete operation to proceed correctly.

    Change-Id: I68a2131fa8ee80828354c9db4ac405c3f77c3b90
    Closes-bug: 1302701

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → juno-1
status: Fix Committed → Fix Released
Revision history for this message
Vitalii (vb-d) wrote :

I have the same issue:
Exception: Multiple floating IPs found for port N.

VPS_NET=10.0.0.9, 10.0.0.10, 10.0.0.11, *.*.*.121, *.*.*.56, *.*.*.49

Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-1 → 2014.2
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/133464

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

Reviewed: https://review.openstack.org/133464
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=39736e88a87a15140309ca39d50bffb2327adbaf
Submitter: Jenkins
Branch: stable/icehouse

commit 39736e88a87a15140309ca39d50bffb2327adbaf
Author: Lars Kellogg-Stedman <email address hidden>
Date: Fri Apr 4 13:35:32 2014 -0400

    allow delete_port to work when there are multiple floating ips

    It is possible to associate multiple floating ip addresses with a single
    port through the use of multiple *fixed* ip addresses, e.g.:

        nova boot ... --nic net-id=my-net-id myserver
        nova add-fixed-ip myserver my-net-id
        nova add-floating-ip --fixed-address x.x.x.1 myserver y.y.y.y.1
        nova add-floating-ip --fixed-address x.x.x.2 myserver y.y.y.y.2

    In this situation, neutron.db.l3_db.disassociate_floatingips would throw
    an exception:

        Exception: Multiple floating IPs found for port <port-id>

    This would prevent someone from deleting an instance that was associated
    with multiple floating ips.

    This patch corrects disassociate_floatingips so that it will
    disassociate all floating ips associated with the port, allowing the
    delete operation to proceed correctly.

    Conflicts:
     neutron/db/l3_db.py

    Change-Id: I68a2131fa8ee80828354c9db4ac405c3f77c3b90
    Closes-bug: 1302701
    (cherry picked from commit bad87ce76ad27f2a4b3c72e26e2eccc2c9564b85)

tags: added: in-stable-icehouse
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.