Ask Your Question
0

how can I configure glance to work with swift with Keystone v3 API?

asked 2015-08-31 10:02:22 -0500

darren-wang gravatar image

we are currently using v3 Identity API now, how can I configure glance to work with swift with Keystone v3 API?

edit retag flag offensive close merge delete

Comments

Are you having swift working well with keystone v3?, If yes then try using the same authentication configuration of swift on the proxyserver to the glance-api.conf, glance-registry.conf

latest_release gravatar imagelatest_release ( 2015-10-13 08:01:12 -0500 )edit

OK, I'll have a try

darren-wang gravatar imagedarren-wang ( 2015-10-15 13:51:03 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-10-16 02:50:04 -0500

latest_release gravatar image

Alright Darren-wang The same problem you were facing i to was facing it configuring keystone v3 to work well with glance.

I finally got it working pretty well and here are the following steps I did for it to work. ie glance and keystone v3

Download the lastest version of glance in my case it was glance 1.1.0, You can either use the package manager, apt-getor you can just https://launchpad.net/glance/liberty/... NOTE when you choose to download from the link above you will have to install the dependencies manually. which are quite very many in my case I had to install them manully around 12+. Ensure you have the lastest update installed.

Install the lastest keystone middleware pip install --upgrade keystonemiddleware

In glance-api.conf --> Section | [keystone_authtoken]

You configurations should have something similar change it according to your needs.

paste.filter_factory = keystonemiddleware.auth_token:filter_factory
auth_uri = http://192.168.1.142:5000
auth_url = http://192.168.1.142:35357
auth_plugin = password
project_domain_name=glance
user_domain_name=glance
project_name=glance
username = glance
password = glance

Under that section you will see | [paste_deploy] it should be

[paste_deploy]
config_file = /etc/glance/glance-api-paste.ini
flavor=keystone

glance-api-paste.ini or /etc/glance/glance-api-paste.ini

Move to secion [filter:authtoken]

paste.filter_factory = keystonemiddleware.auth_token:filter_factory
delay_auth_decision = true
auth_uri = http://192.168.1.142:5000
auth_url = http://192.168.1.142:35357
auth_plugin = password
project_domain_name=glance
user_domain_name=glance
project_name=glance
username = glance
password = glance

Again change it according to your local settings

NOTE: The configurations you applied in glance-api.conf should be the same as glance-registry.conf, and the configurations you applied in glance-api-registry.ini should also apply to glance-registry-ini.

NOTE The project_domain_name, user_domain_name, project_name, username, password, should be valid as for me they are the ones I used I wanted the name to remain the same based on the service that is why everthing is glance.

NOTE Ensure that keystone is working Very well. and you have tested it. with swift or any other service.

I failed to configure the CL(commandline) for glance. but here is a piece of python script to help.

from keystoneclient.v3 import client
from keystoneclient.auth.identity import v3
from keystoneclient import session
#from keystoneclient import client
from keystoneclient.v3.client import exceptions
#from glanceclient import Client 
from glanceclient.v2 import Client 
IMAGE_ENDPOINT="http://192.168.1.103:9292/v2"

auth = v3.Password(
                    auth_url="http://192.168.1.125:5000/v3/",
                    user_domain_name="glance",
                    username="glance", 
                    password="glance",
                    project_domain_name="glance",
                    project_name="glance"
                )

sess = session.Session(auth=auth)
#keystone = client.Client(session=sess)
#print keystone.projects.list()


token =  auth.get_token(sess)
#glance = Client(endpoint=IMAGE_ENDPOINT, session=sess)
glance = Client(endpoint=IMAGE_ENDPOINT, token=token)
#image = glance.images.create(name="Test Image S8software")

print glance.images.list().next()

WARNING It appears that there is a bug in using session with keystone v3. If you pass session to glanceclient.Client, in keystone it will attempt and https:// resulting in 400. I will confirm and file a bug. but when yo up pass token=token ... (more)

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: 2015-08-31 10:02:22 -0500

Seen: 760 times

Last updated: Oct 16 '15