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
@John, could you triage?