Missing binding details for bulk port creation requests

Bug #1696051 reported by Luis Tomas Bolivar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
Undecided
Antoni Segura Puimedon

Bug Description

When doing bulk port creation requests the returned object does not have the binding information -- unlike the 'standard' port creation.

For a single (standard) port creation with:
neutron_client.create_port(rq).get('port')

where rq has:

{'port': {'device_owner': 'compute:kuryr', 'binding:host_id': u'kuryr-devstack', 'name': 'available-port', 'admin_state_up': True, 'network_id': '9b360a57-fb9f-4c6e-a636-b63d0558c551', 'project_id': 'cdf106e1045f47868df764863e58578a', 'fixed_ips': [{'subnet_id': '2d58a9ba-e1d2-4ed1-90d0-a6ea22d0f3aa'}], 'security_groups': ['7c384ae3-b43e-4d5a-b14a-0f0eae8967e0'], 'device_id': ''}}

this is the returned object:
{u'allowed_address_pairs': [], u'extra_dhcp_opts': [], u'updated_at': u'2017-06-05T10:59:45Z', u'device_owner': u'compute:kuryr', u'revision_number': 9, u'port_security_enabled': True, u'binding:profile': {}, u'fixed_ips': [{u'subnet_id': u'2d58a9ba-e1d2-4ed1-90d0-a6ea22d0f3aa', u'ip_address': u'10.0.0.3'}, {u'subnet_id': u'a76b53d2-5654-4256-bafc-73f9756e151a', u'ip_address': u'fd16:3870:3761:0:f816:3eff:fee3:111d'}], u'id': u'4f30dc4d-37a0-4f82-a146-b432ead06860', u'security_groups': [u'7c384ae3-b43e-4d5a-b14a-0f0eae8967e0'], u'binding:vif_details': {u'port_filter': True, u'ovs_hybrid_plug': False}, u'binding:vif_type': u'ovs', u'mac_address': u'fa:16:3e:e3:11:1d', u'project_id': u'cdf106e1045f47868df764863e58578a', u'status': u'DOWN', u'binding:host_id': u'kuryr-devstack', u'description': u'', u'tags': [], u'device_id': u'', u'name': u'available-port', u'admin_state_up': True, u'network_id': u'9b360a57-fb9f-4c6e-a636-b63d0558c551', u'tenant_id': u'cdf106e1045f47868df764863e58578a', u'created_at': u'2017-06-05T10:59:45Z', u'binding:vnic_type': u'normal'}

However, when doing the same call but for bulk requests (i.e., neutron_client.create_port(rq).get('ports')), with rq:
{'ports': [{'device_owner': 'compute:kuryr', 'binding:host_id': u'kuryr-devstack', 'name': 'available-port', 'admin_state_up': True, 'network_id': '9b360a57-fb9f-4c6e-a636-b63d0558c551', 'project_id': 'cdf106e1045f47868df764863e58578a', 'fixed_ips': [{'subnet_id': '2d58a9ba-e1d2-4ed1-90d0-a6ea22d0f3aa'}], 'security_groups': ['7c384ae3-b43e-4d5a-b14a-0f0eae8967e0'], 'device_id': ''}]}

The returned object is:
[{u'allowed_address_pairs': [], u'extra_dhcp_opts': [], u'updated_at': u'2017-06-05T10:59:44Z', u'device_owner': u'compute:kuryr', u'revision_number': 9, u'binding:profile': {}, u'port_security_enabled': True, u'fixed_ips': [{u'subnet_id': u'2d58a9ba-e1d2-4ed1-90d0-a6ea22d0f3aa', u'ip_address': u'10.0.0.6'}, {u'subnet_id': u'a76b53d2-5654-4256-bafc-73f9756e151a', u'ip_address': u'fd16:3870:3761:0:f816:3eff:fec1:a5e4'}], u'id': u'47342c62-8235-4a82-ac0e-681a44d5b7f2', u'security_groups': [u'7c384ae3-b43e-4d5a-b14a-0f0eae8967e0'], u'binding:vif_details': {}, u'binding:vif_type': u'unbound', u'mac_address': u'fa:16:3e:c1:a5:e4', u'project_id': u'cdf106e1045f47868df764863e58578a', u'status': u'DOWN', u'binding:host_id': u'kuryr-devstack', u'description': u'', u'tags': [], u'device_id': u'', u'name': u'available-port', u'admin_state_up': True, u'network_id': u'9b360a57-fb9f-4c6e-a636-b63d0558c551', u'tenant_id': u'cdf106e1045f47868df764863e58578a', u'created_at': u'2017-06-05T10:59:43Z', u'binding:vnic_type': u'normal'}]

Even though it is a bulk creation of only a single port, with the same request information as before (same port attrs but a list of ports, instead of a port dict), the binding details are missing:
u'binding:vif_details': {}, u'binding:vif_type': u'unbound'

Tags: api
Revision history for this message
Trevor McCasland (twm2016) wrote :

By visual inspection it seems valid. Still need to confirm with the API workflow. https://developer.openstack.org/api-guide/quick-start/api-quick-start.html

tags: added: api
Revision history for this message
Kevin Benton (kevinbenton) wrote :

What version?

Revision history for this message
Luis Tomas Bolivar (ltomasbo) wrote :

I tested this with master branch (of a couple of weeks ago) and ocata

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/508438

Changed in neutron:
assignee: nobody → Antoni Segura Puimedon (celebdor)
status: New → In Progress
Changed in neutron:
assignee: Antoni Segura Puimedon (celebdor) → Jakub Libosvar (libosvar)
Changed in neutron:
assignee: Jakub Libosvar (libosvar) → Antoni Segura Puimedon (celebdor)
Revision history for this message
Nate Johnston (nate-johnston) wrote :

I believe the overhauled bulk port code does include the binding information.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by "Antoni Segura Puimedon <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/508438

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.