v2 API: Not possible to "retire" disk formats

Bug #1501046 reported by Nicolas Simonds
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Nicolas Simonds

Bug Description

Use case:

We tried to remove QCOW2 from the list of supported disk_formats in some of our deployments, because the conversion overhead of using them was making for a sub-wonderful user experience.

After removing "qcow2" from the disk_formats parameter, the Glance v2 API started returning 404 errors on extant QCOW2 images. This means that we effectively cannot "retire" this disk format and block new image uploads, since Glance will immediately disavow all knowledge of any QCOW2 images in its purview.

Steps to Reproduce:

    1. Stand up a devstack
    2. Upload a QCOW2 image
    3. glance --os-image-api-version 2 image-show IMAGE_ID
    4. Reconfigure glance-api to only allow e.g., "raw" disk_formats:
        [image_format]
        disk_formats = raw,ami,ari,aki,iso
    5. Restart glance-api
    6. glance --os-image-api-version 2 image-show IMAGE_ID

Expected results:

The "glance image-show" command works both times

Actual results:

The second "glance image-show" command fails.

Errata:

The "glance image-show" using the v1 API does work as expected.

Changed in glance:
assignee: nobody → Kairat Kushaev (kkushaev)
Revision history for this message
Kairat Kushaev (kkushaev) wrote :

So this behavior happens when glanceclient already received image information. You can at least get an info trhough API as workaround.
The root cause is in schema validation after receiving this info. Need to think more about this case.

affects: glance → python-glanceclient
Revision history for this message
Nicolas Simonds (nicolas.simonds) wrote :

Gerrit's auto-assignment robot seems to be on strike again:

https://review.openstack.org/229201

Expanding the definition of "valid" for those two properties in the schema to include all known valid values seems low-impact, and an easy win.

Changed in python-glanceclient:
assignee: Kairat Kushaev (kkushaev) → nobody
Revision history for this message
Kairat Kushaev (kkushaev) wrote :

Nicolas, please assign it to yourself.
One another option is not to validate get request. Honestly, I cannot understand why do we need to validate it additionally because it should be generated by server(and actually it is) not by user. Controller has unvalidated_model that supports that case but it might too big change to introduce.

Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

Thanks for your bug report.

There's currently discussion around a new, standard api for uploading/importing images -- for DefCore requirements.
We need to take this kind of thing into account.

Changed in python-glanceclient:
assignee: nobody → Nicolas Simonds (nicolas.simonds)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

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

Changed in python-glanceclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/229560
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=214dbffc926bfe94145607d5f293734b81a1827d
Submitter: Jenkins
Branch: master

commit 214dbffc926bfe94145607d5f293734b81a1827d
Author: Nicolas Simonds <email address hidden>
Date: Wed Sep 30 09:42:31 2015 -0700

    Skip schema validation on GET /v2/images/%s

    These are server-generated, not user-generated, and schema validation
    should not be necessary.

    Rework a unit test that enforces this; bad data should be blocked
    at ingest, not blocked on reads.

    Co-authored-by: Stuart McLaren <email address hidden>
    Change-Id: Ib1926fec0e858b6eed43c7931a6d6c3a1708e70e
    Closes-Bug: 1501046

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

This issue was fixed in the openstack/python-glanceclient 2.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/288521

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (stable/liberty)

Reviewed: https://review.openstack.org/288521
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=57acbf2ade016cd7b678db6689c4b572499e121c
Submitter: Jenkins
Branch: stable/liberty

commit 57acbf2ade016cd7b678db6689c4b572499e121c
Author: Nicolas Simonds <email address hidden>
Date: Wed Sep 30 09:42:31 2015 -0700

    Skip schema validation on GET /v2/images/%s

    These are server-generated, not user-generated, and schema validation
    should not be necessary.

    Rework a unit test that enforces this; bad data should be blocked
    at ingest, not blocked on reads.

    Co-authored-by: Stuart McLaren <email address hidden>
    Change-Id: Ib1926fec0e858b6eed43c7931a6d6c3a1708e70e
    Closes-Bug: 1501046
    (cherry picked from commit 214dbffc926bfe94145607d5f293734b81a1827d)

tags: added: in-stable-liberty
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-glanceclient 1.1.1

This issue was fixed in the openstack/python-glanceclient 1.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/python-glanceclient 1.1.1 release.

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.