← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Public bug reported:

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

** Affects: neutron
     Importance: Undecided
         Status: New


** Tags: l3-ipam-dhcp

** Tags added: l3-ipam-dhcp

-- 
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 neutron:
  New

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/neutron/+bug/1527089/+subscriptions


Follow ups