nova flavor-list only shows 1000 flavors

Bug #1166455 reported by LaMont Jones
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned
python-novaclient
Fix Released
Undecided
Tiantian Gao
nova (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

After I created a thousand new flavors (to enable some automation), with IDs 1000-1999, nova flavor-list now displays flavor 1, followed by 1000-1998, and then stops.

Flavors 1999 and 2-6 are still valid and usable, just absent from the output of flavor-list (flavor-show is happy to provide details).

(Also, performance seems to have been hurt by the number of flavors. Does it read all the data over the network before printing any of it??)

The nova version in question is folsom.

lamont

Tags: prodstack
LaMont Jones (lamont)
tags: added: prodstack
Chuck Short (zulcss)
affects: nova (Ubuntu) → nova
Revision history for this message
Tiantian Gao (gtt116) wrote :
Download full text (5.0 KiB)

I reproduct the bug.
firstly, close api_rate_limit.

use the command below to create 2000 flavor.
$ for i in {1..2000}; do nova flavor-create f-$i $i 1024 20 1 ;done;

then I use novaclient to list all flavor
$ time nova flavor-list

+------+---------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+------+---------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | True | {} |
| 10 | f-10 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 100 | f-100 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1000 | f-1000 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1001 | f-1001 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1002 | f-1002 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1003 | f-1003 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1004 | f-1004 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1005 | f-1005 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1006 | f-1006 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1007 | f-1007 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1008 | f-1008 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1009 | f-1009 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 101 | f-101 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1010 | f-1010 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1011 | f-1011 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1012 | f-1012 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1013 | f-1013 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1014 | f-1014 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
......
| 1886 | f-1886 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1887 | f-1887 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1888 | f-1888 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1889 | f-1889 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 189 | f-189 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1890 | f-1890 | 1024 | 20 | 0 | | 1 | 1.0 | True | {} |
| 1891 | f-1891 | ...

Read more...

Changed in nova:
status: New → Confirmed
Changed in python-novaclient:
status: New → Confirmed
Chuck Short (zulcss)
Changed in nova (Ubuntu):
status: New → Confirmed
Revision history for this message
Tiantian Gao (gtt116) wrote :

I found there is a configuration item named 'osapi_max_limit=1000', which set the default maximum number of items to return to 1000. So the number of flavor only up to 1000.

We can hit the REST API like this to get more items.
/flavors?limit=2000

But novaclient default get each flavor's extra_spec is annoying me.

Changed in nova:
status: Confirmed → Invalid
Changed in nova (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
assignee: nobody → TianTian Gao (gtt116)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/27060
Committed: http://github.com/openstack/python-novaclient/commit/339689483da3c1591211762ef631d432844ff9ef
Submitter: Jenkins
Branch: master

commit 339689483da3c1591211762ef631d432844ff9ef
Author: Ubuntu <ubuntu@dev-stack-alone.(none)>
Date: Wed Apr 17 13:12:36 2013 +0000

    Make list flavor show extra specs optional.

    Flavor list will get each flavors extra_specs by making fresh requests to nova.
    When there are lots of flavors, the flavor list will take a while to run. So
    let us make show extra-specs optional.

    Fix bug: #1166455

    Change-Id: I86aef1035be6a88b8d9fb49a89f5a608a72589dd

Changed in python-novaclient:
status: In Progress → Fix Committed
Changed in python-novaclient:
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.