Integrating OpenStack ImageService (Glance) with Swift

Setting up Swift is fun, but integrating it with Glance gives it an actual task within the OpenStack virtualization environment. So here's how to do it!

Please note: To make this work, you will at least need version 2012.1-0ubuntu2 of the glance package as there is a bug in previous versions that keeps Glance from cooperating properly with Swift. 

To integrate Glance with Swift, the first thing to do is to find out the actual credentials that Glance has to use to connect with Swift. If you followed this howto, the Glance username will be glance and the password will be hastexo. 

Open /etc/glance/glance-api.conf in a browser and change the value of default_store = to swift. Scroll down to the line starting with swift_store_auth_address and put in the address of the machine running swift-proxy. In this example, the correct entry would be

swift_store_auth_address = http://10.42.0.66:5000/v2.0/

Afterwards, change the value of swift_store_auth_version = to 2, the value of swift_store_user = to service:glance (or the name of the user you used if you used a different one than in this example), the value of swift_store_key = to hastexo (or your local custom password) and the value of swift_store_container to glance. Finally, also make sure that swift_store_create_container_on_put = is set to True. Save the file and restart glance-api:

service glance-api restart

That's it - your Glance will now store its images in Swift! To test this, add an image as described in step 2 of this howto to the Glance image store. If that operation succeedes, your Glance Swift integration is working properly.

Comments

Glance Auth address

 

Shoud this not be
swift_store_auth_address = http://10.42.0.6:5000/v2.0/
I have tried pointing it at the proxy server address 10.42.0.66:5000 and keep getting errors, if I pint it to keystone it seems to work. But don't know if its working correctly.
Any help would be welcome
Cheers
Brendan1495