Skip to content

Commit

Permalink
n-net: add more debug logging to release_fixed_ip
Browse files Browse the repository at this point in the history
Despite commit 8c76902 we're still
seeing this race in the gate so add more debug logging in the
release_fixed_ip method to get a better idea of what's going on.

Related-Bug: #1249065

Change-Id: I9eda6cadf8aa31576bedf10c71c41fe1a3d4d629
  • Loading branch information
Matt Riedemann committed Aug 24, 2015
1 parent a4d4cdd commit fd471b2
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions nova/network/manager.py
Expand Up @@ -1127,15 +1127,28 @@ def release_fixed_ip(self, context, address, mac=None):
# should ignore the request so we don't disassociate the fixed IP
# from the wrong instance.
if mac:
LOG.debug('Checking to see if virtual interface with MAC '
'%(mac)s is still associated to instance.',
{'mac': mac}, instance_uuid=fixed_ip.instance_uuid)
vif = objects.VirtualInterface.get_by_address(context, mac)
if vif and vif.instance_uuid != fixed_ip.instance_uuid:
LOG.info(_LI("Ignoring request to release fixed IP "
"%(address)s with MAC %(mac)s since it is "
"now associated with a new instance that is "
"in the process of allocating it's network."),
{'address': address, 'mac': mac},
instance_uuid=fixed_ip.instance_uuid)
return
if vif:
LOG.debug('Found VIF: %s', vif,
instance_uuid=fixed_ip.instance_uuid)
if vif.instance_uuid != fixed_ip.instance_uuid:
LOG.info(_LI("Ignoring request to release fixed IP "
"%(address)s with MAC %(mac)s since it "
"is now associated with a new instance "
"that is in the process of allocating "
"it's network."),
{'address': address, 'mac': mac},
instance_uuid=fixed_ip.instance_uuid)
return
else:
LOG.debug('No VIF was found for MAC: %s', mac,
instance_uuid=fixed_ip.instance_uuid)

LOG.debug('Disassociating fixed IP %s from instance.', address,
instance_uuid=fixed_ip.instance_uuid)
fixed_ip.disassociate()

@staticmethod
Expand Down

0 comments on commit fd471b2

Please sign in to comment.