← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1527089] Re: [ipam] Port ID is not present in port dict that is passed to AddressRequestFactory

 

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

commit b2d656aff46ac5a2aa9700fc9ff682ef82ecf8e9
Author: Pavel Bondar <pbondar@xxxxxxxxxxxx>
Date:   Sat Dec 19 16:08:36 2015 +0300

    Add generated port id to port dict
    
    Port id generated in create_port was not populated back to port_dict.
    As a result port id information was not available on
    AddressRequestFactory level (used by 3rd party ipam providers).
    
    This fix populates port_id into copied port dict (to prevent affecting
    incoming port dict).
    Added UT to make sure that port id is added to port dict which is passed
    to AddressFactory.
    
    Change-Id: I62e4d9e887488b9ceeafb90b044f95a22c1765b0
    Closes-Bug: #1527089


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1527089

Title:
  [ipam] Port ID is not present in port dict that is passed to
  AddressRequestFactory

Status in networking-infoblox:
  Triaged
Status in neutron:
  Fix Released

Bug description:
  Port dict is passed into AddressRequestFactory [1] to help make ipam decision  based on various port info.
  For reference IPAM driver this information is not used, but it is helpful for creating custom AddressRequests for 3rd party ipam driver.

  Observed that port dict passed into AddressRequestFactory does not contain port id information.
  Here is example of port_dict info captured in AddressRequestFactory:

  {
  'status': 'DOWN',
  'dns_name': '', 
  'binding:host_id': u'vagrant-ubuntu-trusty-64.localdomain', 
  u'name': u'', 
  'allowed_address_pairs': <object object at 0x7f8bd204e270>, 
  u'admin_state_up': True, 
  u'network_id': u'9fc7128d-b4bd-4544-829c-96d19105eb5b', 
  u'tenant_id': u'bf0806763e32436bbdb8fd9b6ebfac93', 
  'extra_dhcp_opts': None, 
  'binding:vnic_type': 'normal', 
  'device_owner': 'network:dhcp', 
  'mac_address': 'fa:16:3e:63:de:76', 
  'binding:profile': <object object at 0x7f8bd204e270>, 
  'port_security_enabled': <object object at 0x7f8bd204e270>, 
  u'fixed_ips': [{u'subnet_id': u'7ca565f8-9cc4-4330-81c9-d3c671beb7b0'}], 
  'security_groups': <object object at x7f8bd204e270>, 
  u'device_id': u'dhcpd439385c-2745-50dd-91dd-8a252bf35915-9fc7128d-b4bd-4544-829c-96d19105eb5b'}

  'id' or 'port_id' is not present in this dict.
  It happens because of the way how create_port() handles id generation [2].
  Port id is generated as uuid (if not set in incoming request, which is typically no),
  but not populated back to original port_dict.
  And original dict(without port_id) is passed down to ipam methods (allocate_ips_for_port_and_store).

  [1] https://github.com/openstack/neutron/blob/master/neutron/ipam/requests.py#L253
  [2] https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L1164

To manage notifications about this bug go to:
https://bugs.launchpad.net/networking-infoblox/+bug/1527089/+subscriptions


References