Glance image-upload truncates the image.

Bug #1361197 reported by Jaroslav Henner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glance_store
Invalid
Undecided
Arnaud Legendre

Bug Description

This may be a DUP of #1240355 but I am not sure.

I have three hosts which all are connected to the same shared NFS datastore and glance configured to use it. I am uploading an image and then try to download, but download returns empty string and there is an ERROR in the glance/api.log:

2014-08-25 09:11:01.438 2724 ERROR glance.api.common [893f9ace-0176-42b1-947f-21b8875547be cffc8c555ebe44bb97b48baabd92e606 94a68b099a674d55986f4ce15fbb946b - - -] Backend storage for image 46b9b487-9c49-47a4-87aa-a11d0b17b6ff disconnected after writing only 0 bytes

The reproducer:

# echo 123456 | glance -d image-create --name foo --disk-format raw --container-format bare
curl -i -X POST -H 'x-image-meta-container_format: bare' -H 'Transfer-Encoding: chunked' -H 'User-Agent: python-glanceclient' -H 'x-image-meta-is_public: False' -H 'X-Auth-Token: ***' -H 'Content-Type: application/octet-stream' -H 'x-image-meta-disk_format: raw' -H 'x-image-meta-name: foo' -d '<open file '<stdin>', mode 'r' at 0x7f38eea620c0>' http://172.16.40.19:9292/v1/images

HTTP/1.1 201 Created
content-length: 467
etag: f447b20a7fcbf53a5d5be013ea0b15af
location: http://172.16.40.19:9292/v1/images/46b9b487-9c49-47a4-87aa-a11d0b17b6ff
date: Mon, 25 Aug 2014 13:10:38 GMT
content-type: application/json
x-openstack-request-id: req-c63d01a6-6c84-4867-8944-f9113497546c

{"image": {"status": "active", "deleted": false, "container_format": "bare", "min_ram": 0, "updated_at": "2014-08-25T13:10:30", "owner": "94a68b099a674d55986f4ce15fbb946b", "min_disk": 0, "is_public": false, "deleted_at": null, "id": "46b9b487-9c49-47a4-87aa-a11d0b17b6ff", "size": 7, "virtual_size": null, "name": "foo", "checksum": "f447b20a7fcbf53a5d5be013ea0b15af", "created_at": "2014-08-25T13:10:20", "disk_format": "raw", "properties": {}, "protected": false}}

+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | f447b20a7fcbf53a5d5be013ea0b15af |
| container_format | bare |
| created_at | 2014-08-25T13:10:20 |
| deleted | False |
| deleted_at | None |
| disk_format | raw |
| id | 46b9b487-9c49-47a4-87aa-a11d0b17b6ff |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | foo |
| owner | 94a68b099a674d55986f4ce15fbb946b |
| protected | False |
| size | 7 |
| status | active |
| updated_at | 2014-08-25T13:10:30 |
| virtual_size | None |
+------------------+--------------------------------------+
[root@incomplete-read ~(keystone_admin)]# glance -d image-download foo
curl -i -X GET -H 'X-Auth-Token: ***' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://172.16.40.19:9292/v1/images/detail?limit=20&name=foo

HTTP/1.1 200 OK
date: Mon, 25 Aug 2014 13:10:52 GMT
content-length: 470
content-type: application/json; charset=UTF-8
x-openstack-request-id: req-b8f1c595-baf4-4a15-b9ae-407e7db3899a

{"images": [{"status": "active", "deleted_at": null, "name": "foo", "deleted": false, "container_format": "bare", "created_at": "2014-08-25T13:10:20", "disk_format": "raw", "updated_at": "2014-08-25T13:10:30", "min_disk": 0, "protected": false, "id": "46b9b487-9c49-47a4-87aa-a11d0b17b6ff", "min_ram": 0, "checksum": "f447b20a7fcbf53a5d5be013ea0b15af", "owner": "94a68b099a674d55986f4ce15fbb946b", "is_public": false, "virtual_size": null, "properties": {}, "size": 7}]}

curl -i -X GET -H 'X-Auth-Token: ***' -H 'Content-Type: application/octet-stream' -H 'User-Agent: python-glanceclient' http://172.16.40.19:9292/v1/images/46b9b487-9c49-47a4-87aa-a11d0b17b6ff
''

Tags: vmware
Revision history for this message
Jaroslav Henner (jhenner) wrote :
Revision history for this message
Flavio Percoco (flaper87) wrote :

@Arnaud, mind looking at this? I think you know the vmware driver better than anyone else here :D

affects: nova → glance
Changed in glance:
assignee: nobody → Arnaud Legendre (arnaudleg)
Revision history for this message
Flavio Percoco (flaper87) wrote :

Wait, the description says NFS but it was tagged as vmware. @Jaroslav, what store are you actually using?

Revision history for this message
Jaroslav Henner (jhenner) wrote :

vmware (vsphere) backend which has datastore configured as NFS. In other words, glance talks to vsphere, vsphere talks to probably to ESXi and those talk to NFS.

description: updated
Revision history for this message
Flavio Percoco (flaper87) wrote :

Have you tested this with other stores? I think this is a vmware specific bug. Either the driver is broken or the store is mis-configured.

Revision history for this message
Jaroslav Henner (jhenner) wrote :

I was trying to reproduce what Tempest does. Tempest was failing when using vmware but not when using file backend, so I do think it is vmware specific.

Erno Kuvaja (jokke)
affects: glance → glance-store
Revision history for this message
Jaroslav Henner (jhenner) wrote :

It seems this has been fixed with
python-glance-store-0.4.0-1.el7ost.noarch

Revision history for this message
Flavio Percoco (flaper87) wrote :

This has been fixed already

Changed in glance-store:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.