Add pagination support to the volume page in the Dashboard

Bug #1316793 reported by Yehia Beyh
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Timur Sufiev

Bug Description

The cinder V2 API supports pagination, however, the dashboard volume page does not currently leverage the support. Without this support the listing of more than a 100 volumes takes a long time. This is really painful and should be fixed.

Yehia Beyh (yehia-beyh)
Changed in horizon:
assignee: nobody → Yehia Beyh (yehia-beyh)
status: New → In Progress
Revision history for this message
Julie Pichon (jpichon) wrote :

Could you provide more information on how the pagination works in Cinder? I tried to look through the client's code but didn't see anything obvious. If it really only works with v2, we'll have to be careful to check for the currently active 'volume' version as Horizon still aims to support both v1 and v2. Thank you!

https://github.com/openstack/horizon/blob/37f2426337/openstack_dashboard/local/local_settings.py.example#L36

David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Medium
Revision history for this message
Cindy Lu (clu-m) wrote :

Hi!

I agree with Julie.

It seems like Cinder V2 supports it: https://github.com/openstack/cinder/blob/master/cinder/api/v2/volumes.py#L228
volumes = self.volume_api.get_all(context, marker, limit, sort_key,
                                          sort_dir, filters)

It seems like Cinder V1 doesn't support it: https://github.com/openstack/cinder/blob/master/cinder/api/v1/volumes.py#L327
volumes = self.volume_api.get_all(context, marker=None, limit=None,
                                          sort_key='created_at',
                                          sort_dir='desc', filters=search_opts)

marker, limit are set to None.

Revision history for this message
tinytmy (tangmeiyan77) wrote :

In cinder V1, now it indeed do not support pagination, related Bug #1321652.
Change the code to:
limit = search_opts.pop('limit', None)
marker = search_opts.pop('marker', None)
volumes = self.volume_api.get_all(context, marker=marker, limit=limit,
                                          sort_key='created_at',
                                          sort_dir='desc', filters=search_opts)

Thus v1 will support pagination.
https://github.com/openstack/cinder/blob/master/cinder/api/v1/volumes.py#L317

Revision history for this message
Cindy Lu (clu-m) wrote :

Hi tinytmy,

Thanks for looking into it. Since v1 is deprecated, we can use [if VERSION.active < 2: ] to decide whether or not to allow for pagination, as Julie noted above.

Revision history for this message
Julie Pichon (jpichon) wrote :

Hello Yehia. Would you have any update about this bug, or could you use any help? People usually expects a patch to be available on Gerrit when a bug is set to "In progress" so the current status is a bit confusing. Thank you!

Revision history for this message
Julie Pichon (jpichon) wrote :

Bug to add pagination support to Cinder Client at bug 1325773.

Changed in horizon:
assignee: Yehia Beyh (yehia-beyh) → Mingyan Bao (bao-mingyan)
Revision history for this message
Mingyan Bao (bao-mingyan) wrote :

I've also submitted a bug to fix a cinder volume list API issue for pagination: bug #1350558

Revision history for this message
Julie Pichon (jpichon) wrote :

Looks like the cinder client pagination patch was merged: https://review.openstack.org/#/c/98010/

Revision history for this message
David Lyle (david-lyle) wrote :

However, the client has not been release since April 2014.

Revision history for this message
David Lyle (david-lyle) wrote :

From the mid-cycle, I think a release will happen soon.

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

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

Changed in horizon:
assignee: Mingyan Bao (bao-mingyan) → Cindy Lu (clu-m)
Changed in horizon:
assignee: Cindy Lu (clu-m) → Timur Sufiev (tsufiev-x)
Timur Sufiev (tsufiev-x)
Changed in horizon:
assignee: Timur Sufiev (tsufiev-x) → Cindy Lu (clu-m)
Changed in horizon:
assignee: Cindy Lu (clu-m) → Timur Sufiev (tsufiev-x)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/118450
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=091d351553207981a28a3258e8c3ab7a660543de
Submitter: Jenkins
Branch: master

commit 091d351553207981a28a3258e8c3ab7a660543de
Author: Mingyan Bao <email address hidden>
Date: Tue Sep 2 15:35:17 2014 -0400

    Add pagination support to the volume page

    Cinder v2 supports pagination.
    Added to the volumes table for both admin and project.
    Also fix the Cinder REST API to handle pagination (like Glance
    REST API).

    To test: set 'Items Per Page' in the UI Settings page to a low number.

    Co-Authored-By: Cindy Lu <email address hidden>
    Co-Authored-By: Timur Sufiev <email address hidden>

    Change-Id: Ib1772d6e6214dc96a09ce32fb4d9f9fb79d161f0
    Closes-Bug: #1316793

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 9.0.0.0b3

This issue was fixed in the openstack/horizon 9.0.0.0b3 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.