Strange Issues, Integrating Glance with Keystone v3

asked 2015-10-14 04:27:17 -0500

latest_release gravatar image

updated 2015-10-14 09:25:55 -0500

SGPJ gravatar image

Please help, I know such question could have been asked by after two days of searching not real success.

I setup swift to work with keystone v3 and it worked fined. But when I attempted to integrate `glance(0.15.0)` authentication always returns 401. Here is a master piece of python code I was using to list images from glance server.

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 

IMAGE_ENDPOINT="http://192.168.1.5:9292/v2"

auth = v3.Password(
                    auth_url="http://192.168.1.142: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)
#print token 
glance = Client(endpoint=IMAGE_ENDPOINT, token=token)
print glance.images.list().next()

I followed a simple setup of glance and here is what is suggested.

And here is what is in my glance-api.conf and glance-registry.conf

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

Am perfomed some analysis on the keystone authentication module on glance controller the response from the authentication server is 200, showing success but they still show an error

When I analysed the request being sent to the authentication server. no data is send to the server all which could have been kind of password username domain

Response Code from Auth server

2015-10-14 12:12:59.159 14685 DEBUG keystoneclient.session [-] RESPONSE <Response [200]>  _http_log_response /usr/lib/python2.7/dist-packages/keystoneclient/session.py:207
2015-10-14 12:12:59.159 14685 DEBUG keystoneclient.session [-] HEADERS None  _http_log_response /usr/lib/python2.7/dist-packages/keystoneclient/session.py:208
2015-10-14 12:12:59.159 14685 DEBUG keystoneclient.session [-] TEXT None  _http_log_response /usr/lib/python2.7/dist-packages/keystoneclient/session.py:209
2015-10-14 12:12:59.159 14685 DEBUG keystoneclient.session [-] STATAUS CODE None  _http_log_response /usr/lib/python2.7/dist-packages/keystoneclient/session.py:210
2015-10-14 12:12:59.159 14685 DEBUG keystoneclient.session [-] RESP: [200] date: Wed, 14 Oct 2015 09:12:59 GMT content-type: application/json content-length: 335 vary: X-Auth-Token x-distribution: Ubuntu

Request Being sent to the Authentication server

2015-10-14 12:12:58.831 14685 DEBUG keystoneclient.auth.identity.v3 [-] Making authentication request to http://192.168.1.142:35357/v3/auth/tokens get_auth_ref /usr/lib/python2.7/dist-packages/keystoneclient/auth/identity/v3.py:126
2015-10-14 12:12:59.151 14685 DEBUG keystoneclient.session [-] URL http://192.168.1.142:35357/v3  _http_log_request /usr/lib/python2.7/dist-packages/keystoneclient/session.py:171
2015-10-14 12:12:59.151 14685 DEBUG keystoneclient.session [-] METHOED GET  _http_log_request /usr/lib/python2.7/dist-packages/keystoneclient/session.py:172
2015-10-14 12:12:59.152 14685 DEBUG keystoneclient.session [-] DATA None  _http_log_request /usr/lib/python2.7/dist-packages/keystoneclient/session.py:173
2015-10-14 12:12:59.152 ...
(more)
edit retag flag offensive close merge delete

Comments

Hey, your code works on my server with keystone 1.6.0 and glance 0.19.0. Could you get a correct image-list when running glance image-list with configurations in glance-api.conf (just to assure the auth = v3.Password(...) part is correctly configurated)?

Cheng Liu gravatar imageCheng Liu ( 2015-10-14 07:40:41 -0500 )edit

Could it be the version of glance am using whichs 0.15.0 and keystone version is is 1.7.2. Let me try your suggestion.

latest_release gravatar imagelatest_release ( 2015-10-15 00:39:22 -0500 )edit