Network related cleanup might fail on instance deletion

Bug #939580 reported by François Charlier on 2012-02-23
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
François Charlier

Bug Description

When an instance is deleted/destroyed, an async call is sent to nova-network while the nova-compute related deletion continues.

In various places, nova-network fetches data from the db without checking on deleted instances and floating ips, fixed ips, security groups, … might then not be deallocated.

Relevant information from nova-network.log :

2012-02-21 18:57:04,303 DEBUG [req-7dc512a4-a895-41ea-86e1-ff8ce8f27901 dd5093c768c24ed391955b1dde5cf411 08972d4e0424497483de1c0a5123ea9b] floating IP deallocation for instance |86| from (pid=14288) debug /usr/lib/python2.7/dist-packages/nova/
2012-02-21 18:57:04,359 ERROR nova.rpc [-] Exception during message handling
(nova.rpc): TRACE: Traceback (most recent call last):
(nova.rpc): TRACE: File "/usr/lib/python2.7/dist-packages/nova/rpc/", line 244, in _process_data
(nova.rpc): TRACE: rval = node_func(context=ctxt, **node_args)
(nova.rpc): TRACE: File "/usr/lib/python2.7/dist-packages/nova/network/", line 200, in wrapped
(nova.rpc): TRACE: return func(self, context, *args, **kwargs)
(nova.rpc): TRACE: File "/usr/lib/python2.7/dist-packages/nova/network/", line 304, in deallocate_for_instance
(nova.rpc): TRACE: affect_auto_assigned=True)
(nova.rpc): TRACE: File "/usr/lib/python2.7/dist-packages/nova/network/", line 200, in wrapped
(nova.rpc): TRACE: return func(self, context, *args, **kwargs)
(nova.rpc): TRACE: File "/usr/lib/python2.7/dist-packages/nova/network/", line 464, in disassociate_floating_ip
(nova.rpc): TRACE: instance = self.db.instance_get(context, fixed_ip['instance_id'])
(nova.rpc): TRACE: File "/usr/lib/python2.7/dist-packages/nova/db/", line 580, in instance_get
(nova.rpc): TRACE: return IMPL.instance_get(context, instance_id)
(nova.rpc): TRACE: File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/", line 119, in wrapper
(nova.rpc): TRACE: return f(*args, **kwargs)
(nova.rpc): TRACE: File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/", line 1457, in instance_get
(nova.rpc): TRACE: raise exception.InstanceNotFound(instance_id=instance_id)
(nova.rpc): TRACE: InstanceNotFound: Instance 86 could not be found.
(nova.rpc): TRACE:

Changed in nova:
assignee: nobody → François Charlier (francois-charlier)
status: New → In Progress

Submitter: Jenkins
Branch: master

commit 5ad1dea4daf264fe11429288597d26dc4974fe05
Author: François Charlier <email address hidden>
Date: Thu Feb 23 16:32:54 2012 +0100

    nova-network can't deallocate ips from deleted instances

    Allow nova-network to deallocate assigned IPs from deleted instances

    Fix bug #939580

    Change-Id: Ib24fea0701cf640721cd0b021c78c8c5dfbb507b
    Signed-off-by: François Charlier <email address hidden>

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-02-29
Changed in nova:
milestone: none → essex-4
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-4 → 2012.1
Mathew Odden (locke105) wrote :

I am still running into this issue in 2012.1

I verified that the proposed code changes are in my nova/network/ file as well.

I don't even see a log message from nova-network about trying to deallocate the IPs when an instance is deleted.

Mathew Odden (locke105) wrote :

Alright so I'm not sure if this is the same issue at all, but here is my steps to recreate what my problem is.

1. Create instance
2. Assign floating ip from any pool
3. Delete instance from nova client or Dashboard
4. Try to access the Access & Security tab or do a nova floatin-ip-list
5. Get a " ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) "

To fix this I have to go into the database and disassociate the floating ip and fixed IP from the instance ID

Msekni (msekni) wrote :

i am having this issue too even after the fix !!

Christian Parpart (trapni) wrote :

how can I officially fix this issue? I just ran into the same issue as in #4, however, I did not know what exactly was meant by "disassociating", in fact, I deleted my floating IP instead.

 best would be to auto-detach the floating-IP on instance termination.

does this correspond to the bug in ?

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

Other bug subscribers