Description of problem: Neutron added bulk creation operations for certain resources like ports and subnets some time ago. This operations allow you to create N resources with a single API request. Unfortunately, internally Neutron processes each of the N resources separately multiplying by N the amount of works that needs to be done in large stretches of the creation flow. All in all it makes it common for a 2000 port creation operation where all the requested ports are equal to take close to one hour. This feature requests the code to be optimized so that if all the requested ports are equal, they be processed together and perform just x database transactions instead of xN transactions. Steps to Reproduce: 1. source openrc 2. Create the following script #!/usr/bin/env python import sys import os_client_config from pprint import pprint neutron = os_client_config.make_client('network', cloud='envvars') nova = os_client_config.make_client('compute', cloud='envvars') hypervisors = nova.hypervisors.list() bulk_port_req = {'ports': []} for hyper in hypervisors: if 'compute-0' in hyper.hypervisor_hostname: continue bulk_port_req['ports'].extend([{ 'binding:host_id': hyper.hypervisor_hostname, 'project_id': sys.argv[2], 'network_id': sys.argv[3], 'device_owner': 'compute:kuryr', 'admin_state_up': True, 'name': 'kaboom', 'security_groups': sys.argv[4].split(',')} for _ in range(int(sys.argv[1]))]) ports = neutron.create_port(bulk_port_req).get('ports') pprint(ports) 3. chmod +x port_creator 4. Create the ports by doing: ./port_creator 2000 project_uuid network_uuid security_groups_comma_separated_uuids Actual results: The ports are created in x*N transactions as visible in the log. Expected results: The ports are created in x transactions as visible in the log.
Final change 624815 merged upstream March 21st.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:2957