nova list doesn't work above api max_limit

Bug #1743532 reported by Jacek Tomasiak
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Undecided
Jacek Tomasiak

Bug Description

When requested `--limit` is above `max_limit` set in nova API configuration or no limit is specified (or limit=-1) and number of instances is higher than `max_limit` the output of `nova list` is cut to `max_limit` entries.

Example:
max_limit = 3

Expected output:
# nova list
+--------------------------------------+-------+--------+------------+-------------+----------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------+--------+------------+-------------+----------------------+
| 3b4bdc95-8cbe-40e4-97ca-ef83f15e3b2b | inst1 | ACTIVE | - | Running | fixed=192.168.123.9 |
| 936607a4-c5a9-4d81-a497-47e2c3be1928 | inst2 | ACTIVE | - | Running | fixed=192.168.123.10 |
| 44af16f0-ccb7-44de-b787-5af39095abca | inst3 | ACTIVE | - | Running | fixed=192.168.123.14 |
| b5d93027-f132-44ed-9975-4bacc3c3be0a | inst4 | ACTIVE | - | Running | fixed=192.168.123.6 |
| c4e925ae-85c3-4442-8038-386a7b0b2b61 | inst5 | ACTIVE | - | Running | fixed=192.168.123.3 |
| f962d85b-3e94-49cf-bd90-afb054f20735 | inst6 | ACTIVE | - | Running | fixed=192.168.123.15 |
| ca378516-c4d2-4216-830d-c2c7c69a6947 | inst7 | ACTIVE | - | Running | fixed=192.168.123.17 |
| 3fe2d243-7d62-49fc-a70f-b80ec326325d | inst8 | ACTIVE | - | Running | fixed=192.168.123.13 |
| d799ec11-bf97-4481-b6fc-07e13e6ea338 | inst9 | ACTIVE | - | Running | fixed=192.168.123.18 |
+--------------------------------------+-------+--------+------------+-------------+----------------------+

actual output:
# nova list
+--------------------------------------+-------+--------+------------+-------------+----------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------+--------+------------+-------------+----------------------+
| ca378516-c4d2-4216-830d-c2c7c69a6947 | inst7 | ACTIVE | - | Running | fixed=192.168.123.17 |
| 3fe2d243-7d62-49fc-a70f-b80ec326325d | inst8 | ACTIVE | - | Running | fixed=192.168.123.13 |
| d799ec11-bf97-4481-b6fc-07e13e6ea338 | inst9 | ACTIVE | - | Running | fixed=192.168.123.18 |
+--------------------------------------+-------+--------+------------+-------------+----------------------+

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/534222

Changed in python-novaclient:
assignee: nobody → Jacek Tomasiak (skazi)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/534222
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=eff607ccef91d09052d58f6798f68d67404f51ce
Submitter: Zuul
Branch: master

commit eff607ccef91d09052d58f6798f68d67404f51ce
Author: Jacek Tomasiak <email address hidden>
Date: Tue Jan 16 11:09:26 2018 +0100

    Fix listing of instances above API max_limit

    Output of `nova list` command contained only `max_limit` entries even
    when there were more. The list needs to be obtained in multiple
    requests and the paging loop was terminated prematurely.

    Change-Id: I4194e6d5e34ecc0ac704851c08bb895e223aa850
    Closes-Bug: 1743532

Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/543968

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-novaclient (stable/queens)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/queens
Review: https://review.openstack.org/543968

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 10.2.0

This issue was fixed in the openstack/python-novaclient 10.2.0 release.

Revision history for this message
sean mooney (sean-k-mooney) wrote :

for future readers the fix for this was reverted in https://review.openstack.org/#/c/572539/
the actual fix appers to be to pass --limit=-1 so this change was not needed and intoduced another bug
https://bugs.launchpad.net/nova/+bug/1773945

Revision history for this message
s10 (vlad-esten) wrote :

Original behaviour causing a bug in Watcher and Ceilometer. They use novaclient python bindings.
https://github.com/openstack/ceilometer/blob/master/ceilometer/nova_client.py#L146 https://github.com/openstack/watcher/blob/master/watcher/common/nova_helper.py#L76
They expect nova.servers.list(search_opts={'all_tenants': True}) to return full list of instances, not only max_limit number.

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.