No error/warning raised when attempting to re-upload image data

Bug #1403003 reported by Itzik Brown
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Kuo-tung Kao (jelly)

Bug Description

When modifying an image file and then updating the image by using glance image-update --file <filename> <Image Name>
doesn't update the image

How to reproduce
================
Download an image and upload it:

# wget http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2
# glance image-create --name fedora21b --disk-format qcow2 --container-format bare --is-public True --file /tmp/Fedora-Cloud-Base-20141203-21.x86_64.qcow2

Create some dummy file in /tmp/dummy and modify the image
# virt-copy-in -a Fedora-Cloud-Base-20141203-21.x86_64.qcow2 /tmp/dummy /etc

Update the image:
#glance image-update --file Fedora-Cloud-Base-20141203-21.x86_64.qcow2 fedora21

Verify the image is not updated by comparing the checksum
# md5sum /var/lib/glance/images/bd84ac96-c2a8-4268-a19c-a0e69c703baf
# md5sum Fedora-Cloud-Base-20141203-21.x86_64.qcow2

When using --checksum the checksum in the image properties is updated but the the image itself not:
#glance image-update --file Fedora-Cloud-Base-20141203-21.x86_64.qcow2 --checksum 2c98b17b3f27d14e2e7a840fef464cfe fedora21

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

Images are immutable. You cannot change an existing image's bytes.

The image-update command should not be failing silently, it should be detecting that image data is already present (the image is in an active state) and that the --file input cannot be uploaded.

summary: - Updating an image by uploading a new file doesn't update the image
+ No error/warning raised when attempting to re-upload image data
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

This should be changed to a python-glanceclient bug I think -- assuming the server is returning 403 or whatever for re-uploading the bytes.

Changed in glance:
importance: Undecided → Low
Revision history for this message
Itzik Brown (itzikb1) wrote :

There is no error at all.
So there is also a need to change http://docs.openstack.org/user-guide/content/cli_manage_images.html to make it clear for the user.

Changed in glance:
assignee: nobody → usha veepuri (usha-veepuri)
Changed in glance:
assignee: usha veepuri (usha-veepuri) → nobody
Changed in glance:
assignee: nobody → jelly (coding1314)
Revision history for this message
Kuo-tung Kao (jelly) (coding1314) wrote :

The bug seems to be fixed already. When I try to update the data of the image whose status is active using the command "glance image-update --file a.py a", it show the message "Unable to upload image data to an image which is active.". I thought the bug have been fixed already. I test the bug in kilo. Does anyone confirm again? Thank you.

Changed in glance:
status: New → Incomplete
Revision history for this message
Itzik Brown (itzikb1) wrote :

jelly,
Thanks. You are right - it's fixed.

Changed in glance:
status: Incomplete → Fix Released
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.