Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

openstack version 2.3.0: swift and glance

Hi openstack community!

I intend to use swift as a backend for instances and there images in a test environment for openstack with Debian Jessie 8 but I failed with using swift for images of virtual machines. I assume I need to reconsider keystone but I am not sure and I don't know how. I tried to avoid to add many configuration files but if you need one, please let me know.

For configuring swift I used this manual: http://docs.openstack.org/project-install-guide/object-storage/draft/

I was able to verfiy that swift is working, after I used the ubuntu section (http://docs.openstack.org/project-install-guide/object-storage/draft/controller-install-ubuntu.html) instead of the debian section (http://docs.openstack.org/project-install-guide/object-storage/draft/controller-install-debian.html).

Then I tried to find documentation for using swift as backend for virtual machines but I failed with this documentation: http://www.unixarena.com/2015/10/openstack-re-configure-glance-to-use-swift-storage.html

I tried this to get the image into swift:

 openstack image create "cirros4swift"   --file cirros-0.3.4-x86_64-disk.img   --disk-format qcow2 --container-format bare   --public

And I get the message:

500 Internal Server Error The server has either erred or is incapable of performing the requested operation. (HTTP 500)

This is a part of glance-api.log while I tried to upload image to swift:

2016-10-07 13:42:01.785 29097 ERROR glance.api.v2.image_data   File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 617, in get_auth
2016-10-07 13:42:01.785 29097 ERROR glance.api.v2.image_data     auth_version=auth_version)
2016-10-07 13:42:01.785 29097 ERROR glance.api.v2.image_data   File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 543, in get_auth_keystone
2016-10-07 13:42:01.785 29097 ERROR glance.api.v2.image_data     raise ClientException('Authorization Failure. %s' % err)
2016-10-07 13:42:01.785 29097 ERROR glance.api.v2.image_data ClientException: Authorization Failure. Authorization Failed: The resource could not be found. (HTTP 404) (Request-ID: req-cdfbf316-8934-42ee-8429-5ef1ce112f74) (HTTP 404)
2016-10-07 13:42:01.785 29097 ERROR glance.api.v2.image_data 
2016-10-07 13:42:01.869 29097 ERROR glance.common.wsgi [req-86dfcf42-ad48-4e55-b5d2-72489783892c 4bcf960e75944ce6bd1dded437021a8e ca77a1956ef2426195fb3eb73785229e - - -] Caught error: Authorization Failure. Authorization Failed: The resource could not be found. (HTTP 404) (Request-ID: req-cdfbf316-8934-42ee-8429-5ef1ce112f74) (HTTP 404)

The message "The resource could not be found" I tried to understand but I was not able to find out what's the missing resource.

The glance-api.conf on the controller node for swift, where I tried additional configuration lines which contains swift, like swift_store_endpoint for example:

[DEFAULT]
default_store = swift
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://glance:reinda@controller/glance
[glance_store]
stores = swift,file,http
default_store = swift
swift_store_auth_address = http://controller:35357/v3
swift_store_user = service:swift
swift_store_key = PASS
swift_store_create_container_on_put = True
swift_store_region = RegionOne
swift_store_endpoint = http://controller:8080/v1
swift_store_container = container1

[image_format]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = pass

[matchmaker_redis]
[oslo_concurrency]
lock_path = /var/lock/glance

[oslo_messaging_amqp]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
rabbit_host = localhost
rabbit_userid = guest
rabbit_password =

[oslo_policy]
[paste_deploy]
flavor = keystone

[profiler]
[store_type_location_strategy]
[task]
[taskflow_executor]

The message "The resource could not be found" let me conclude that there might be missing some swift configuration lines. So I tried to give the missing resource with "swift_store_region = RegionOne" and other configuration lines with swift_* but after restartet glance-api and glance-register I got the same message.

The line needs explanation: swift_store_container = container1

I create "container1" with this command

openstack container create container1

So I guessed the missing resource is the name of the created container but this was not the missing resource.

The account-server.conf on the object store servers(10.0.0.208, another with 10.0.0.209):

[DEFAULT]
bind_ip = 10.0.0.208
bind_port = 6002
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True

[pipeline:main]
pipeline = healthcheck recon account-server

[app:account-server]
use = egg:swift#account

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift

[account-replicator]
[account-auditor]
[account-reaper]
[filter:xprofile]
use = egg:swift#xprofile

It seems to me very difficult to configure swift and glance as I am working on that issue since this week but may be somebody can help me.

Cheers

Matt