Public bug reported: Originally reported at https://bugzilla.redhat.com/show_bug.cgi?id=2222102
-- When nova creates a VM, it issues a request to fetch all ports for the project, which may take a significant time and even time out. The code in https://github.com/openstack/nova/blob/master/nova/network/neutron.py#L2654 suggests that nova fetches IDs of all project ports just to count the number of ports in db and compare it to quota (to pre-validate that there's enough free ports to allocate for the request). Instead of fetching all IDs via get_ports, nova should attempt to use quota_details API that gives ready access to info on available ports: https://docs.openstack.org/api-ref/network/v2/?expanded=list-quotas-for- projects-with-non-default-quota-values-detail,show-quota-details-for-a- tenant-detail#quotas-details-extension-quota-details Note that this is an API extension and was added later than the original `quota` API, so it may be that special care should be taken to accommodate to neutron-servers with no such extension. Also, the extension seems to be controlled by the cfg.CONF.QUOTAS.quota_driver config option: https://github.com/openstack/neutron/blob/6fa9142ced0eed8de9a89042747438b93de7202d/neutron/extensions/quotasv2_detail.py#L37 Which means that there may be an (upstream) configuration that would end up with quota_details API missing. So a fallback mechanism may be due. Side note: it may be argued that neutron should not expose this config option in the first place. This bz doesn't attempt to address this request. ** Affects: nova Importance: Undecided Status: New ** Tags: neutron ** Tags added: neutron -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/2027156 Title: nova should use quota_details neutron api to validate available ports before VM creation Status in OpenStack Compute (nova): New Bug description: Originally reported at https://bugzilla.redhat.com/show_bug.cgi?id=2222102 -- When nova creates a VM, it issues a request to fetch all ports for the project, which may take a significant time and even time out. The code in https://github.com/openstack/nova/blob/master/nova/network/neutron.py#L2654 suggests that nova fetches IDs of all project ports just to count the number of ports in db and compare it to quota (to pre-validate that there's enough free ports to allocate for the request). Instead of fetching all IDs via get_ports, nova should attempt to use quota_details API that gives ready access to info on available ports: https://docs.openstack.org/api-ref/network/v2/?expanded=list-quotas- for-projects-with-non-default-quota-values-detail,show-quota-details- for-a-tenant-detail#quotas-details-extension-quota-details Note that this is an API extension and was added later than the original `quota` API, so it may be that special care should be taken to accommodate to neutron-servers with no such extension. Also, the extension seems to be controlled by the cfg.CONF.QUOTAS.quota_driver config option: https://github.com/openstack/neutron/blob/6fa9142ced0eed8de9a89042747438b93de7202d/neutron/extensions/quotasv2_detail.py#L37 Which means that there may be an (upstream) configuration that would end up with quota_details API missing. So a fallback mechanism may be due. Side note: it may be argued that neutron should not expose this config option in the first place. This bz doesn't attempt to address this request. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/2027156/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

