Ask Your Question
0

Ocata: Why can't glance write the image to disk?

asked 2017-04-11 06:34:19 -0500

HumongousRainDrop gravatar image

updated 2017-04-11 09:18:42 -0500

I am beginning an Ocata(git) installation from scratch. I got Keystone up and running, at least to the point where I can manage services, endpoints, projects and users using the openstack cli.

Next on my list is Glance. I installed the api and registry services, registered them with keystone and an openstack image list does show me an empty list, as it should. However, I cannot add an image to glance. More specifically I cannot upload one.

I can create an image using openstack image create. As long as I don't provide a file to upload via the --file option the image is created successfully. I can view it, set properties and delete the image just fine. But as soon as I try to upload an image, either during creation using openstack image create or afterwards using glance image-upload, The request is not successful. It always ends at:

CommunicationError: Error finding address for http://localhost:9292/v2/images/9bfdcf7a-a6ff-4c0a-a7ea-8f702020c929/file: [Errno 32] Broken pipe

With this error openstack image create would go ahead and delete the contentless image from glance (successfully), while glance image-create would leave the empy image in the repository, which I can delete without any problems using openstack image delete.

In the log file of the Glance API service, every uploading attempt produces a log entry like this:

2017-04-11 13:26:37.667 28283 DEBUG glance_store._drivers.filesystem [req-39a78c77-09b2-4f37-b59a-2f26d78e41df 4a9ac02efb5a4368a80f4d6bbbd4e000 fcbc09cefb6f4bcbbc7400090e6a5f77 - default default] Wrote 0 bytes to /var/lib/libvirt/images/openstack/glance/images/9bfdcf7a-a6ff-4c0a-a7ea-8f702020c929 with checksum d41d8cd98f00b204e9800998ecf8427e add /opt/openstack/lib/python2.7/site-packages/glance_store/_drivers/filesystem.py:706

Watching Glance do its work I can confirm, that Glance can create an empty file on the datastore and delete the empty file. But apparently it cannot write data into the file. I checked, the user (stack) may CRUD files in that diectory just fine.

The directory, where Glance is supposed to store its images, is on a dedicated partition mounted to /var/lib/libvirt/images/. The full path where Glance shall store the images is /var/lib/libvirt/images/openstack/glance/images/. The path exists and Glance obviously can create empty files in it and delete them.

Why won't it write data to it?

Update 00

The initial problem is, that the LimitingReader-object, that is supposed to provide the image so that it can be written to disk in glance_store/_drivers/filesystem.py:add(), is empty.

Update 01

There is a problem when uploading the image. It appears Glance interrupts the file transfer prematurely. The broken pipe error message and the overall failure seems to originate at my client programs. I went ahead and created an image without uploading data:

 openstack image create --disk-format qcow2 --container-format bare --min-ram 1024 --min-disk 4 "Cirros" --public

and the I uploaded the data using curl

curl -i -X PUT \
    -H "X-Auth-Token: supercalifragilisticexpialidocious"  \
    -H "Content-Type: application/octet-stream" \
    -d @/tmp/8mb \      
    http://localhost:9292/v2/images/abf5c327-cbf8-453f-b560-38d82bb80ec6/file

No error messages what soever, but the log file knows ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-04-10 13:21:57 -0500

Not sure if it is applicable to your instance. I had same error ans symptoms. I had a proxy env variable set and it interrupted uploading glance images.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2017-04-11 06:34:19 -0500

Seen: 1,349 times

Last updated: Apr 11 '17