Glance API shows authentication errno 1 during uploading image to swift's container
Hello folks,
I have met problem during configuration of Swift as a backend storage service for Glance. I have configured Glance according to Red Hat Instalation Guide.
Now when I am trying to upload image using glance image-create
command following message occures:
[root@openstack182 ~]# glance image-create --name="Cirros 0.3.1" --disk-format=qcow2 --container-format bare < /tmp/images/cirros-0.3.1-x86_64-disk.img
Request returned failure status.
500 Internal Server Error
The server has either erred or is incapable of performing the requested operation.
(HTTP 500)
So the problem is with Swift server. Although Swift is able to create containers and upload files to them using swift upload
command:
[root@openstack182 ~]# swift upload c4 data3.file
data3.file
[root@openstack182 ~]# swift list
c1
c2
c3
c4
[root@openstack182 ~]# swift list c4
data3.file
Glance also works well if the default_store
parameter is set to file
.
After attempting to upload image to swift's container Glance API logs shows there is some problem with authentication:
[root@openstack182 ~]# glance image-create --name="Cirros 0.3.1" --disk-format=qcow2 --container-format bare < /tmp/images/cirros-0.3.1-x86_64-disk.img
Request returned failure status.
500 Internal Server Error
The server has either erred or is incapable of performing the requested operation.
(HTTP 500)
[root@openstack182 ~]# date
czw, 22 sie 2013, 14:39:00 CEST
[root@openstack182 ~]# tail -n 50 /var/log/glance/api.log
2013-08-22 14:38:49.316 ERROR glance.api.v1.images [f32b8f75-054d-4be0-a048-dd797016d043 f554f1bf0c964ab3843214c0dfabf7a6 c154fa85885b4589aeb3b76f3a8d8beb] Failed to upload image
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images Traceback (most recent call last):
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images File "/usr/lib/python2.6/site-packages/glance/api/v1/images.py", line 444, in _upload
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images image_meta['size'])
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images File "/usr/lib/python2.6/site-packages/glance/store/swift.py", line 321, in add
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images self._create_container_if_missing(location.container, connection)
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images File "/usr/lib/python2.6/site-packages/glance/store/swift.py", line 490, in _create_container_if_missing
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images connection.head_container(container)
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1070, in head_container
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images return self._retry(None, head_container, container)
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1022, in _retry
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images self.url, self.token = self.get_auth()
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1010, in get_auth
2013-08-22 14:38:49.316 8466 TRACE glance.api.v1.images insecure=self.insecure)
2013-08-22 14:38 ...
maybe somehow glance is using the wrong port to talk to swift? can you paste the swift section of your glance config?