nova.network.neutronv2.api.validate_networks could be smarter when listing ports

Bug #1521788 reported by Matt Riedemann
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann

Bug Description

There are two things we can do to make this more efficient:

https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1182

1. Move the list_ports call after the unlimited quota check - if the quota is unlimited, we don't need to list ports.

2. Filter the list_ports response to only return the port id, we don't need the other port details in the response since we don't use those fields, we're just getting a count.

Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Low
status: New → Triaged
assignee: nobody → Matt Riedemann (mriedem)
tags: added: low-hanging-fruit
description: updated
Changed in nova:
assignee: Matt Riedemann (mriedem) → nobody
Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/252659
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=bf027800f7badf547681d64e124b60523712b4be
Submitter: Jenkins
Branch: master

commit bf027800f7badf547681d64e124b60523712b4be
Author: Matt Riedemann <email address hidden>
Date: Wed Dec 2 13:54:50 2015 -0800

    neutron: only list ports if there is a quota limit when validating

    The list_ports call can take awhile if the project has a lot of ports.
    If it turns out that there is unlimited quota, then we don't even need
    to list the ports, so move that after the show_quota call.

    Partial-Bug: #1521788

    Change-Id: I4d128f182283ffa4479934f640a67d9c536824b5

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/253931
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=768887b6fcc72e30fb9fa58d817a1b5c56203e4a
Submitter: Jenkins
Branch: master

commit 768887b6fcc72e30fb9fa58d817a1b5c56203e4a
Author: Matt Riedemann <email address hidden>
Date: Sun Dec 6 06:51:11 2015 -0800

    neutron: only get port id when listing ports in validate_networks

    The validate_networks method is called from the compute API before
    casting off to build instances. If the project has a lot of ports, the
    list call to neutron can be slow, so we should optimize this method as
    much as possible. One way to do that is rather than get the port details
    back, we just get the id since all we care about is the number of ports
    assigned to the project.

    Closes-Bug: #1521788

    Change-Id: Icddba161112526dde23184ee80ad5cb60fe66cc6

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/nova 13.0.0.0b2

This issue was fixed in the openstack/nova 13.0.0.0b2 development milestone.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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