Ask Your Question
1

Glance API shows authentication errno 1 during uploading image to swift's container

asked 2013-08-22 07:45:19 -0600

piotrkopec gravatar image

updated 2013-08-22 07:46:21 -0600

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 ...
(more)
edit retag flag offensive close merge delete

Comments

maybe somehow glance is using the wrong port to talk to swift? can you paste the swift section of your glance config?

clayg gravatar imageclayg ( 2013-08-22 12:36:41 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-03-23 16:45:02 -0600

echiu gravatar image

It appears you may have issues with glance/swift integration in your configuration. The following configuration sample of /etc/glance/glance-api.conf is taken from a working setup for your reference.

## NB: Unpolished config file
## This config file was taken directly from the upstream repo, and tweaked just enough to work.
## It has not been audited to ensure that everything present is either Heat controlled or a mandatory as-is setting.
## Please submit patches for any setting that should be deleted or Heat-configurable.
##  https://git.openstack.org/cgit/openstack/tripleo-image-elements

[DEFAULT]

# Introducing logging config for JSON logging
log_config_append=/etc/glance/api-logging.conf

# New style hierarchic (glance.api) params
default_store = file

known_stores = glance.store.filesystem.Store, glance.store.swift.Store

bind_port = 9292

sql_connection = mysql://glance:c57a7c33394fef60c0de626946a054b8bf80bf6a@localhost/glance

registry_port = 9191

rabbit_use_ssl = false
rabbit_userid = guest
rabbit_password = guest
rabbit_virtual_host = /
rabbit_notification_exchange = glance
rabbit_notification_topic = notifications
rabbit_host = 127.0.0.1

filesystem_store_datadir = /mnt/state/var/lib/glance/images/

swift_store_auth_version = 2
swift_store_auth_address = http://127.0.0.1:5000/v2.0/
swift_store_endpoint_type = internalURL

swift_store_container = glance
swift_store_create_container_on_put = True
swift_store_large_object_size = 5120
swift_store_large_object_chunk_size = 200
swift_enable_snet = False

delayed_delete = False
scrub_time = 43200
scrubber_datadir = /mnt/state/var/lib/glance/scrubber

image_cache_dir = /mnt/state/var/lib/glance/image-cache/

[keystone_authtoken]
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol=http
auth_uri = http://127.0.0.1:5000/v2.0
admin_tenant_name = service
admin_user = glance
admin_password = 4d73a373336934bd36ef1d0ccac41e616eccc0ba

[paste_deploy]
flavor = keystone
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

1 follower

Stats

Asked: 2013-08-22 07:45:19 -0600

Seen: 1,719 times

Last updated: Mar 23 '15