Activity log for bug #1940074

Date Who What changed Old value New value Message
2021-08-16 11:44:11 Andrey Bubyr bug added bug
2021-08-16 11:44:52 Andrey Bubyr description Bulk port creation does not honor binding:vnic_type field. It implicitly uses binding:vnic_type: normal Example of bulk creation API call: curl -v --location --request POST 'https://<neutron_url>/v2.0/ports' --header 'Content-Type: application/json' --header 'X-Auth-Token: <redacted>' --data-raw '{ "ports" : [ { "name" : "port1", "admin_state_up" : true, "network_id" : "c2a3464a-dbea-40c9-b421-9313e33992be", "binding:vnic_type" : "direct" }, { "name" : "port2", "admin_state_up" : true, "network_id" : "27dd162f-e8ac-4b21-84f4-e4dff6836fa0", "binding:vnic_type" : "macvtap" }] }' At the same time vnic_type is honored in 'single port' of this API, f.e. with payload like "port" : { "name" : "port_single", "admin_state_up" : true, "network_id" : "c2a3464a-dbea-40c9-b421-9313e33992be", "binding:vnic_type" : "direct" } }' Seems that binding:vnic_type from port parameters is not passed thru inside create_port_bulk() function. I've found a workaround. The following line should be added after https://review.opendev.org/plugins/gitiles/openstack/neutron/+/refs/heads/master/neutron/plugins/ml2/plugin.py#1594: port_dict[portbindings.VNIC_TYPE] = pdata.get( portbindings.VNIC_TYPE) Bulk port creation does not honor binding:vnic_type field. It implicitly uses binding:vnic_type: normal Example of bulk creation API call: curl -v --location --request POST 'https://<neutron_url>/v2.0/ports' --header 'Content-Type: application/json' --header 'X-Auth-Token: <redacted>' --data-raw '{   "ports" : [ {     "name" : "port1",     "admin_state_up" : true,     "network_id" : "c2a3464a-dbea-40c9-b421-9313e33992be",     "binding:vnic_type" : "direct"   }, {     "name" : "port2",     "admin_state_up" : true,     "network_id" : "27dd162f-e8ac-4b21-84f4-e4dff6836fa0",     "binding:vnic_type" : "macvtap"   }] }' At the same time vnic_type is honored in 'single port' mode of this API, f.e. with payload like   "port" : {     "name" : "port_single",     "admin_state_up" : true,     "network_id" : "c2a3464a-dbea-40c9-b421-9313e33992be",     "binding:vnic_type" : "direct"   } }' Seems that binding:vnic_type from port parameters is not passed thru inside create_port_bulk() function. I've found a workaround. The following line should be added after https://review.opendev.org/plugins/gitiles/openstack/neutron/+/refs/heads/master/neutron/plugins/ml2/plugin.py#1594:                 port_dict[portbindings.VNIC_TYPE] = pdata.get(                     portbindings.VNIC_TYPE)
2021-08-16 13:17:33 Slawek Kaplonski neutron: status New Confirmed
2021-08-16 13:17:36 Slawek Kaplonski neutron: importance Undecided Medium
2021-08-16 13:17:49 Slawek Kaplonski tags api low-hanging-fruit
2021-08-16 13:34:07 OpenStack Infra neutron: status Confirmed In Progress
2021-08-31 07:28:35 OpenStack Infra neutron: status In Progress Fix Released
2022-11-08 16:26:06 OpenStack Infra tags api low-hanging-fruit api in-stable-wallaby low-hanging-fruit
2022-11-11 17:53:32 OpenStack Infra tags api in-stable-wallaby low-hanging-fruit api in-stable-victoria in-stable-wallaby low-hanging-fruit