Attempting to upload an image to a non-queued image appears to succeed

Bug #1395084 reported by Louis Taylor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Medium
Louis Taylor

Bug Description

Steps to reproduce:

Create an image and upload data:

    $ glance image-create --name non-queued --disk-format qcow2 --container-format bare --file some_image.img

Status of the image should now be 'active'. Now any attempts to upload different data will apparently succeed:

    $ glance --debug image-update --file different_image.img <image-uuid>

+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 4eada48c2843d2a262c814ddc92ecf2c |
| container_format | bare |
| created_at | 2014-11-21T16:56:14 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | d50b0236-b27c-412a-91b9-18ceafa9cc5a |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | non-queued |
| owner | 07389013e3224e1488f0450f2582a1b9 |
| protected | False |
| size | 25165824 |
| status | active |
| updated_at | 2014-11-21T17:04:57 |
| virtual_size | None |
+------------------+--------------------------------------+

In actual fact, updating the image data of a non-queued image is not allowed and the new image data is silently stripped away from the request by the client before it is sent to the glance server. The fact that this operation has not succeeded should be communicated to the user.

Erno Kuvaja (jokke)
Changed in python-glanceclient:
status: New → Triaged
importance: Undecided → Medium
Louis Taylor (kragniz)
Changed in python-glanceclient:
assignee: nobody → Louis Taylor (kragniz)
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/136520

Changed in python-glanceclient:
status: Triaged → In Progress
Louis Taylor (kragniz)
Changed in python-glanceclient:
milestone: none → v0.16.0
Changed in python-glanceclient:
milestone: v0.16.0 → v.16.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

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

commit af29e0a1b0185caa61c3aed30c35a2d8f0e216cc
Author: Louis Taylor <email address hidden>
Date: Wed Dec 3 02:24:44 2014 +0000

    Show error on trying to upload to non-queued image

    Previously, attempting to upload data to an image which has a status
    which is not 'queued' would appear to succeed, when the data has
    actually never been sent to the glance server. To the user, it appeared
    that their request was successful. This patch adds a check for incoming
    image data on the 'image-update' command, and exits with an error if the
    specified image does not have the status 'queued'.

    Examples:

        $ cat os.img | glance image-update d50b0236-b27c-412a-91b9-18ceafa9cc5a
        Unable to upload image data to an image which is active.

        $ glance image-update --file os.img d50b0236-b27c-412a-91b9-18ceafa9cc5a
        Unable to upload image data to an image which is killed.

    Change-Id: I91bbd7f86d5851a5e35946c711dba1932283ed79
    Closes-Bug: #1395084

Changed in python-glanceclient:
status: In Progress → Fix Committed
Changed in python-glanceclient:
status: Fix Committed → Fix Released
Revision history for this message
Xiang Hui (xianghui) wrote :

Hi guys,

Would it be helpful to update to the Chapter 6. Image service command-line client in [1] that the image content could be only updated when the image status is 'queued'.

[1] http://docs.openstack.org/cli-reference/content/glanceclient_commands.html#glanceclient_subcommand_image-update

Thanks.

Revision history for this message
Tom Fifield (fifieldt) wrote :

Hi,

http://docs.openstack.org/cli-reference/content/glanceclient_commands.html#glanceclient_subcommand_image-update

comes from the glance client code, so it should be updated in python-glanceclient - openstack-manuals just automatically pulls things in.

no longer affects: openstack-manuals
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.