Listing orphaned neutron objects with listorphans.py is slow

Bug #1515300 reported by Nick Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Operators
Fix Released
Undecided
Nick Jones

Bug Description

Listing orphaned neutron objects via the listorphans.py script is terribly slow, owing to that fact that for every instance of an object it does a distinct Keystone API call to check whether or not that object's tenant ID exists.

This could be streamlined by fetching a list of all project IDs once and then doing the comparison against that list to see if an object's associated tenant ID is still valid.

Nick Jones (yankcrime)
Changed in osops:
status: New → In Progress
assignee: nobody → Nick Jones (yankcrime)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to osops-tools-generic (master)

Reviewed: https://review.openstack.org/244160
Committed: https://git.openstack.org/cgit/openstack/osops-tools-generic/commit/?id=f243b8c739e589a17bfcfe2fca7ed5744e71900e
Submitter: Jenkins
Branch: master

commit f243b8c739e589a17bfcfe2fca7ed5744e71900e
Author: Nick Jones <email address hidden>
Date: Wed Nov 11 15:21:12 2015 +0000

    Address performance issues with listorphans.py script

    listorphans.py lists orphaned Neutron objects. 'Orphans' in this
    context are objects which OpenStack knows about and manages but which do
    not have a valid project (tenant) ID.

    The previous version was very inefficient in that for every object being
    checked, it would do a discrete Keystone API call to see if the
    associated tenant ID was valid or not. For an installation of any
    reasonable size, i.e one with 100s of Neutron routers, this method was
    particularly slow.

    The script has been updated to first build a list of all tenant IDs, and
    then for every Neutron object check project ownership validity against
    this list instead.

    Output has also changed slightly to print out a list of discovered
    orphans, simplifying workflow e.g when piping to another command which
    cleans up these objects.

    Closes-Bug: #1515300

    Change-Id: I72ca84fe48beb623d43ee446a32ea1bb30730bcc

Changed in osops:
status: In Progress → Fix Committed
JJ Asghar (d-jj)
Changed in osops:
status: Fix Committed → Fix Released
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.