nova network deallocates fixed IP with non unique field in DB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
High
|
Unassigned |
Bug Description
Tried many diff configurations for openstack network service.
Found Openstack deallocated fixd IP with non unique field in DB table
fixed_ips, whose field name is address.
How to reproduce:
1.create openstack network 10.0.100.0/24, range 256.
2.delete this network.
3.recreate it.
4.nova delete instance id.
Then the bug fired with exception as below.
2012-09-17 21:59:50 TRACE nova.rpc.amqp Traceback (most recent call last):
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
2012-09-17 21:59:50 TRACE nova.rpc.amqp rval = node_func(
**node_args)
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
wrapped
2012-09-17 21:59:50 TRACE nova.rpc.amqp return func(self, context, *args,
**kwargs)
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
deallocate_
2012-09-17 21:59:50 TRACE nova.rpc.amqp super(FloatingIP,
self).deallocat
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
wrapped
2012-09-17 21:59:50 TRACE nova.rpc.amqp return func(self, context, *args,
**kwargs)
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
deallocate_
2012-09-17 21:59:50 TRACE nova.rpc.amqp **kwargs)
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
deallocate_fixed_ip
2012-09-17 21:59:50 TRACE nova.rpc.amqp network =
self._get_
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
_get_network_by_id
2012-09-17 21:59:50 TRACE nova.rpc.amqp return self.db.
network_id)
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
2012-09-17 21:59:50 TRACE nova.rpc.amqp return IMPL.network_
network_id)
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
wrapper
2012-09-17 21:59:50 TRACE nova.rpc.amqp return f(*args, **kwargs)
2012-09-17 21:59:50 TRACE nova.rpc.amqp File
"/usr/lib/
network_get
2012-09-17 21:59:50 TRACE nova.rpc.amqp if not result:
2012-09-17 21:59:50 TRACE nova.rpc.amqp NetworkNotFound: Network 1 could not be
found.
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → High |
tags: | added: folsom-rc-potential |
After walking through code, I got the coding solution for this bug. python2. 6/site- packages/ nova/network/ manager. py fixed_ip( self, context, address, host, **kwargs): fixed_ip_ get_by_ address( context, address) network_ by_id(context, fixed_ip[ 'network_ id'])
in /usr/lib/
def deallocate_
"""Call the superclass deallocate_fixed_ip if i'm the correct host
otherwise call to the correct host"""
fixed_ip = self.db.
network = self._get_
The fixed_ip_ get_by_ address( ) method should have more sanity check to avoid
this bug.