glance update won't update custom properties

Bug #747665 reported by Tom vN
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Dan Prince

Bug Description

Using glance revno: 100
I ran "glance update 8" which wiped off all custom properties, which might also be a bug but isn't this bug.

To correct this I run "glance update 8 image_location=local image_state=available type=image architecture=x86_64 owner_id=admin".
I can see the x-image-meta-property headers in the Put however a "glance details" shows no custom properties.
What's strange is if I "glance update 8 ' image_location'=local" (noting the space in the key) I then see a custom property of ' image_location'.

Revision history for this message
Kevin Bringard (kbringard) wrote :

I have seen a similar issue (which is probably another symptom of the same bug):

When I run a glance update, it will blast any previously defined custom properties. If I then try to re-add those properties, I cannot. For example:

glance show 5
URI: http://0.0.0.0/images/5
Id: 5
Public: Yes
Name: Centos5-5.5-Base_VM
Size: 816906240
Location: file:///var/lib/glance/images/5
Disk format: ami
Container format: ami
Property 'flavor': CentOS 5
Property 'type': machine
Property 'creator': Kevin

glance update 5 build_date="04-01-2011"
Updated image 5

root@e3ab3:~# glance show 5
URI: http://0.0.0.0/images/5
Id: 5
Public: Yes
Name: Centos5-5.5-Base_VM
Size: 816906240
Location: file:///var/lib/glance/images/5
Disk format: ami
Container format: ami
Property 'build_date': 04-01-2011

glance update 5 build_date="04-01-2011" flavor="CentOS 5" type="machine" creator="Kevin"
Updated image 5
root@e3ab3:~# glance show 5
URI: http://0.0.0.0/images/5
Id: 5
Public: Yes
Name: Centos5-5.5-Base_VM
Size: 816906240
Location: file:///var/lib/glance/images/5
Disk format: ami
Container format: ami
Property 'build_date': 04-01-2011

The original custom properties are also gone when I visit http://0.0.0.0:9292/images/detail

I think I need to enable glance logging as I don't see any traces, so once I find some I'll add some additional information.

Revision history for this message
Kevin Bringard (kbringard) wrote :

I should also note that because the type=machine custom property gets blasted, it breaks euca-describe-images (it took me awhile to figure that one out, so hopefully this comment saves someone else some time :-))

Revision history for this message
Kevin Bringard (kbringard) wrote :

Looking at the database I see that the properties are still there, they are just updated to have "deleted" set to 1. Updating them to be 0 resolves the issue. I am looking at the glance update code now to try to determine why it is setting them to deleted (this may be by design?).

Revision history for this message
Jay Pipes (jaypipes) wrote :

Terribly sorry about this, guys. We had a revision recently that caused this issue, and the code has been fixed. Please see the merge proposal here: https://code.launchpad.net/~dan-prince/glance/purge_props/+merge/55351.

Please refresh your trunk version and let me know if this problem persists. You will need to do the manual database update Kevin mentions...

Revision history for this message
Kevin Bringard (kbringard) wrote :

Ahhhh, that makes sense. Thanks Jay!

Revision history for this message
Kevin Bringard (kbringard) wrote :

It looks as though the latest release resolves the issue (2011.2~bzr100-0ubuntu0ppa1~maverick2)

Revision history for this message
Jay Pipes (jaypipes) wrote :

OK, cool. We'll be cleaning this up in Diablo, just FYI, to make the API better. Something like:

GET/HEAD/PUT/POST /images/<ID>/props
DELETE /images/<ID>/props/<KEY>

Cheers!
jay

Changed in glance:
status: New → Fix Committed
importance: Undecided → High
milestone: none → cactus-2011-04-07
assignee: nobody → Dan Prince (dan-prince)
Thierry Carrez (ttx)
Changed in glance:
milestone: cactus-2011-04-07 → 2011.2
status: Fix Committed → Fix Released
Revision history for this message
Kevin Jackson (kevin-linuxservices) wrote :

This is still seems to be a bug in play - wasn't sure if to raise a new one, or its very close to the same issue I've got.

Updating an image in glance blows away any meta-data.

ii glance 2011.3-0ubuntu4.1 OpenStack Image Registry and Delivery Service - Daemons
ii python-glance 2011.3-0ubuntu4.1 OpenStack Image Registry and Delivery Service - Python library

I've uploaded an image with cloud-publish-tarball...
euca-describe-images brings back the normal details, manifest xml, arch, etc.

I then went to update an image from private to public:

$ glance show 1

URI: http://0.0.0.0/images/1
Id: 1
Public: No
Name: None
Status: active
Size: 4779168
Disk format: aki
Container format: aki
Minimum Ram Required (MB): 0
Minimum Disk Required (GB): 0
Property 'image_location': images/oneiric-server-cloudimg-i386-vmlinuz-virtual.manifest.xml
Property 'image_state': available
Property 'project_id': demo
Property 'architecture': i386

$ glance update 1 is_public=True

$ glance show 1

URI: http://0.0.0.0/images/1
Id: 1
Public: No
Name: None
Status: active
Size: 4779168
Disk format: aki
Container format: aki
Minimum Ram Required (MB): 0
Minimum Disk Required (GB): 0

$ euca-describe-images now shows (e.g.)

IMAGE aki-00000001 available public kernel instance-store

Revision history for this message
Kevin Jackson (kevin-linuxservices) wrote :

(that last paste was from a cut+paste where I set image back to private... (hence Public: No)... that's not an issue - that was just me picking the wrong paste!)

Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi Kevin,

Unfortunately, when you call glance update, you need to include all the original custom properties along with the call, otherwise those properties will be marked deleted. :( This is not ideal, I know, but it is documented in the glance update command:

jpipes@uberbox:~/repos/glance$ ./bin/glance help update

glance update [options] <ID> <field1=value1 field2=value2 ...>

Updates an image's metadata in Glance. Specify metadata fields as arguments.

Metadata fields that are not specified in the update command will be deleted.
<snip>

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.