← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1190585] Re: Race condition for auto assigned addresses in Nova networking

 

** Changed in: nova
       Status: Fix Committed => Fix Released

** Changed in: nova
    Milestone: None => havana-rc1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1190585

Title:
  Race condition for auto assigned addresses in Nova networking

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  The allocate_for_instance() code in Nova networking FlatDHCPManager
  for auto assigning a floating IP splits the allocation and setting of
  the auto assigned column into two steps:

   if CONF.auto_assign_floating_ip:
              # allocate a floating ip
              floating_address = self.allocate_floating_ip(context, project_id,
                  True)
              LOG.debug(_("floating IP allocation for instance "
                          "|%(floating_address)s|") % locals(),
                          instance_uuid=instance_uuid, context=context)
              # set auto_assigned column to true for the floating ip
              self.db.floating_ip_set_auto_assigned(context, floating_address)

  
  In the (very) short window between allocation and floating_ip_set_auto_assigned the about to be auto assigned address becomes visible to the user, and if they're quick enough they can de-allocate it just before the allocate_for_instance call goes ahead and sets the auto assigned flag and associates it to the fixed IP of the instance, leaving the DB in an inconsistent state (the address is in use but not allocated to a project).

  The fix would be to set the auto_assigned attribute as part of the
  initial allocation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1190585/+subscriptions