missing some saved quotas values in manila share tab

Bug #1842119 reported by Gloria Gu
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
manila-ui
Fix Released
Undecided
Gloria Gu

Bug Description

Horizon need to fix https://bugs.launchpad.net/horizon/+bug/1798048?comments=all in order to be able to save quotas for manila-ui otherwise save manila quotas will have a 500 error.

From identity/projects click one of the projects, click modify quotas action, a dialog comes up, if update quotas fields in compute tab without entering values in share tab, the save button will not respond and have some console errors (hit F12 to open browser dev tool).

Entering values in share tab, click save, it will save successfully (with horizon fix), however when open the dialog again, the saved values are empty for share.

This is caused by that manila-ui doesn't get quotas in manilar_ui/dashboards/identity/projects/workflows.py

class UpdateShareQuota(workflows.Step):

Once I updated to call api_manila.tenant_quota_get to populate input fields in modal share tab
, then only field of shares and share_network have data, other fields are empty.

responded data:

DEBUG:manilaclient.common.httpclient:RESP: [200] {'Date': 'Thu, 29 Aug 2019 22:21:38 GMT', 'Server': 'Apache/2.4.29 (Ubuntu)', 'Content-Type': 'application/json', 'Content-Length': '148', 'x-compute-request-id': 'req-b54967f6-2955-41b3-b336-3b8b2f47b79f', 'X-OpenStack-Manila-API-Version': '2.32', 'Vary': 'X-OpenStack-Manila-API-Version', 'Connection': 'close'}
RESP BODY: {"quota_set": {"gigabytes": 2, "snapshots": 2, "snapshot_gigabytes": 2, "shares": 2, "id": "1b1c32996fc3467fb5db1d355cfa0cb8", "share_networks": 2}}

the data returned mismatched with the UI fields.
MANILA_QUOTA_FIELDS = {
    "shares",
    "share_gigabytes",
    "share_snapshots",
    "share_snapshot_gigabytes",
    "share_networks",
}

Mishmatch problem also exist in admin->system-> defaults for manila-ui

Gloria Gu (gloria-gu)
Changed in manila-ui:
status: New → In Progress
assignee: nobody → Gloria Gu (gloria-gu)
Gloria Gu (gloria-gu)
description: updated
Revision history for this message
Noor Yameen (nooryameen19) wrote :

api_manila.tenant_quota_get where exactly have you add this call ?

Revision history for this message
Noor Yameen (nooryameen19) wrote :

i dont think its a mismatch issue since we have a map function in manila.py
def _map_quota_names_for_update(data):
    mapping = {
        'share_gigabytes': 'gigabytes',
        'share_snapshots': 'snapshots',
        'share_snapshot_gigabytes': 'snapshot_gigabytes',
    }

Revision history for this message
Gloria Gu (gloria-gu) wrote :

@Noor, let me do some more tests, I can push the changes so you can check.

Revision history for this message
Gloria Gu (gloria-gu) wrote :

@Noor i see, why when update, it converts UI share_gigabytes to gigabytes?

Because of that, when it gets back it is like

{"quota_set": {"gigabytes": 2, "snapshots": 2, "snapshot_gigabytes": 2, "shares": 2, "id": "1b1c32996fc3467fb5db1d355cfa0cb8", "share_networks": 2}}

in

default_quota_get
tenant_quota_get

In order for UI to show in field share_gigbytes, it needs convert gigbytes back to share_gigbytes.

However we can not simply remove the conversion _map_quota_names_for_update(data): , the existing data will be affected.

Revision history for this message
Gloria Gu (gloria-gu) wrote :

read code a little big more the update conversion fixed https://bugs.launchpad.net/manila-ui/+bug/1679960 the changes is in https://review.opendev.org/#/c/460698/5

I see some conversions in that patch.

However the latest code I don't see any place calls api tenant_quota_get.

I add the following function in manila_ui/dashboards/identity/projects/workflows.py

    def prepare_action_context(self, request, context):
        try:
            quotas = api_manila.tenant_quota_get(
                request, context['project_id'])
....

after get the data, need convert them back so the UI can display them correctly.

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

Fix proposed to branch: master
Review: https://review.opendev.org/679897

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 16.0.0.0rc2

This issue was fixed in the openstack/horizon 16.0.0.0rc2 release candidate.

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

Reviewed: https://review.opendev.org/679897
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=c763ebe6cd89657aa820ea14774fa3c95e4d0a6b
Submitter: Zuul
Branch: master

commit c763ebe6cd89657aa820ea14774fa3c95e4d0a6b
Author: Gloria Gu <email address hidden>
Date: Tue Sep 3 21:10:56 2019 -0700

    Updated to get quotas data for Modify Quotas dialog Share tab

    Current Modfiy Quotas action of a project in Identity->Projects
    for manila ui does not get quotas data for the project. If user
    updated quotas for manila ui, the saved data will not be shown
    in the Modify Quotas dialog Share tab.

    This commit includes:
    1) Added a call to get quotas data and also maps the data
    fields retuned to the UI data fields.
    2) Added unit tests.
    3) Added a release note.

    Change-Id: I5fb9cef577b109530fde9a4bafe930ea05f3fed8
    Closes-bug: #1842119
    Depends-on: https://review.opendev.org/#/c/679513/

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

Fix proposed to branch: stable/train
Review: https://review.opendev.org/688792

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila-ui (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/688804

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila-ui (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/688813

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila-ui (stable/train)

Reviewed: https://review.opendev.org/688792
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=7f0c6ad276d42289c61761e9cdcaa3720f7be764
Submitter: Zuul
Branch: stable/train

commit 7f0c6ad276d42289c61761e9cdcaa3720f7be764
Author: Gloria Gu <email address hidden>
Date: Tue Sep 3 21:10:56 2019 -0700

    Updated to get quotas data for Modify Quotas dialog Share tab

    Current Modfiy Quotas action of a project in Identity->Projects
    for manila ui does not get quotas data for the project. If user
    updated quotas for manila ui, the saved data will not be shown
    in the Modify Quotas dialog Share tab.

    This commit includes:
    1) Added a call to get quotas data and also maps the data
    fields retuned to the UI data fields.
    2) Added unit tests.
    3) Added a release note.

    Change-Id: I5fb9cef577b109530fde9a4bafe930ea05f3fed8
    Closes-bug: #1842119
    Depends-on: https://review.opendev.org/#/c/679513/
    (cherry picked from commit c763ebe6cd89657aa820ea14774fa3c95e4d0a6b)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila-ui (stable/stein)

Reviewed: https://review.opendev.org/688804
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=cc52163a36cd4863ebe96bfef0a163b4190d01b2
Submitter: Zuul
Branch: stable/stein

commit cc52163a36cd4863ebe96bfef0a163b4190d01b2
Author: Gloria Gu <email address hidden>
Date: Tue Sep 3 21:10:56 2019 -0700

    Updated to get quotas data for Modify Quotas dialog Share tab

    Current Modfiy Quotas action of a project in Identity->Projects
    for manila ui does not get quotas data for the project. If user
    updated quotas for manila ui, the saved data will not be shown
    in the Modify Quotas dialog Share tab.

    This commit includes:
    1) Added a call to get quotas data and also maps the data
    fields retuned to the UI data fields.
    2) Added unit tests.
    3) Added a release note.

    Change-Id: I5fb9cef577b109530fde9a4bafe930ea05f3fed8
    Closes-bug: #1842119
    Depends-on: https://review.opendev.org/#/c/679513/
    (cherry picked from commit c763ebe6cd89657aa820ea14774fa3c95e4d0a6b)
    (cherry picked from commit 7f0c6ad276d42289c61761e9cdcaa3720f7be764)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila-ui (stable/rocky)

Reviewed: https://review.opendev.org/688813
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=bfc45c381aebe6aaf83f0098a21a473a60134bf0
Submitter: Zuul
Branch: stable/rocky

commit bfc45c381aebe6aaf83f0098a21a473a60134bf0
Author: Gloria Gu <email address hidden>
Date: Tue Sep 3 21:10:56 2019 -0700

    Updated to get quotas data for Modify Quotas dialog Share tab

    Current Modfiy Quotas action of a project in Identity->Projects
    for manila ui does not get quotas data for the project. If user
    updated quotas for manila ui, the saved data will not be shown
    in the Modify Quotas dialog Share tab.

    This commit includes:
    1) Added a call to get quotas data and also maps the data
    fields retuned to the UI data fields.
    2) Added unit tests.
    3) Added a release note.

    Change-Id: I5fb9cef577b109530fde9a4bafe930ea05f3fed8
    Closes-bug: #1842119
    Depends-on: https://review.opendev.org/#/c/679513/
    (cherry picked from commit c763ebe6cd89657aa820ea14774fa3c95e4d0a6b)
    (cherry picked from commit 7f0c6ad276d42289c61761e9cdcaa3720f7be764)
    (cherry picked from commit cc52163a36cd4863ebe96bfef0a163b4190d01b2)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila-ui 2.16.2

This issue was fixed in the openstack/manila-ui 2.16.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila-ui 2.18.1

This issue was fixed in the openstack/manila-ui 2.18.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila-ui 2.19.1

This issue was fixed in the openstack/manila-ui 2.19.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 14.0.4

This issue was fixed in the openstack/horizon 14.0.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 15.1.1

This issue was fixed in the openstack/horizon 15.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 17.0.0

This issue was fixed in the openstack/horizon 17.0.0 release.

Revision history for this message
Vern Hart (vern) wrote :

This fix made it into the stable/train branch in the git repo but the python3-manila-ui deb package (2.19.0-0ubuntu1~cloud0) installed from the bionic/train cloud archive does not have the fix.

   deb http://ubuntu-cloud.archive.canonical.com/ubuntu bionic-updates/train main

How do we get the package updated?

Revision history for this message
Mark Maglana (mmaglana) wrote :

It looks like this change is not present in focal/ussuri since I've had to patch the manila-ui plugin to get it to show up on the dashboard. Version is as follows:

$ sudo apt list --installed | grep manila-ui
python3-manila-ui/focal-updates,now 1:3.0.0-0ubuntu0.20.04.1 all [installed]

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.