Xenapi glance plugin resets custom image properties

Bug #820935 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Dan Prince

Bug Description

Using Glance trunk (revision 179).

Glance doesn't appear to be returning user created properties. Some properties get returned (os_type for example). However most other properties don't.

For image 18 I have the following data in the image_properties table:

sqlite> select * from image_properties where image_id = 18;
100|18|backup_type||2011-08-04 13:26:35.983018|2011-08-04 13:26:44.004689||1
96|18|image_state|creating|2011-08-04 13:26:35.978061|2011-08-04 13:26:44.000496||1
98|18|image_type|snapshot|2011-08-04 13:26:35.980809|2011-08-04 13:26:44.002573||1
99|18|instance_id|28|2011-08-04 13:26:35.981914|2011-08-04 13:26:44.003690||1
95|18|instance_uuid|656055c9-d821-474e-a516-55d46cd3836f|2011-08-04 13:26:35.976770|2011-08-04 13:26:43.994884||1
101|18|os_type|linux|2011-08-04 13:26:43.993645|||0
97|18|user_id|admin|2011-08-04 13:26:35.979677|2011-08-04 13:26:44.001566||1

---

But I get back the following HTTP headers when using the API:

  HTTP/1.1 200 OK
  Content-Length: 263864320
  Content-Type: application/octet-stream
  X-Image-Meta-Id: 18
  X-Image-Meta-Deleted: False
  X-Image-Meta-Container_format: ovf
  X-Image-Meta-Location: file:///var/lib/glance/images/18
  X-Image-Meta-Deleted_at:
  X-Image-Meta-Created_at: 2011-08-04T13:26:35.972744
  X-Image-Meta-Size: 263864320
  X-Image-Meta-Status: active
  X-Image-Meta-Property-Os_type: linux
  X-Image-Meta-Is_public: True
  X-Image-Meta-Owner:
  X-Image-Meta-Updated_at: 2011-08-04T13:27:58.379366
  X-Image-Meta-Checksum: 5912e9768978c3725ad401ea637aa065
  X-Image-Meta-Disk_format: vhd
  X-Image-Meta-Name: Just In Case
  Location: http://localhost:9292/v1/images/18
  Etag: 5912e9768978c3725ad401ea637aa065
  Date: Thu, 04 Aug 2011 13:39:11 GMT
  Connection: keep-alive

---

A request directly to the registry on port 9191 returns similar results:

{"image": {"status": "active", "name": "Just In Case", "deleted": false, "container_format": "ovf", "created_at": "2011-08-04T13:26:35.972744", "disk_format": "vhd", "updated_at": "2011-08-04T13:27:58.379366", "properties": {"os_type": "linux"}, "location": "file:///var/lib/glance/images/18", "checksum": "5912e9768978c3725ad401ea637aa065", "owner": null, "is_public": true, "deleted_at": null, "id": 18, "size": 263864320}}

Related branches

Dan Prince (dan-prince)
Changed in glance:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Dan Prince (dan-prince)
Revision history for this message
Dan Prince (dan-prince) wrote :

The issue here appears to be related to the fact that the user created properties are marked as deleted.

This is happening on images created on snapshots via nova... Looking into whether the cause is on that end.

Revision history for this message
Dan Prince (dan-prince) wrote :

Yeah. This is a nova issue. When creating snapshots nova:

1) initially creates the image with all its metadata.

2) When using XenServer the glance plugin does an image update to add some properties for the image type ('ovf', etc). All of the properties in the initial set that aren't in this request are marked as deleted.

We need to update the XenServer plugin to re-send these initial properties (if possible).

affects: glance → nova
Dan Prince (dan-prince)
summary: - Glance isn't returning custom (user created) properties
+ Xenapi glance plugin resets custom image properties
Dan Prince (dan-prince)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-4
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-4 → 2011.3
status: Fix Committed → 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.