Glance service selection from ServiceCatalog when using keystone

Bug #904850 reported by Stuart McLaren on 2011-12-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stuart McLaren

Bug Description

When glance receives a token from the keystone server it looks through the
returned json for a serviceName:

            for service in resp_auth['serviceCatalog']:
                if service['name'] == 'glance':

We were in touch with the Keystone folks about this:

You're correct, they should be looking at the type field. The name is purely an operator-specified, marketing name (I.e. At Rackspace we would call it "Cloud Servers").

Yes, the core openstack services are canonical. Any other services should be added as extensions (ex: "HP-dnsext:dns"). This is specified in the XSD contracts (but not enforced in JSON as
we don't have validation there…. Yet…



the change would be something like:

--- a/glance/common/
+++ b/glance/common/
@@ -175,7 +175,7 @@ class KeystoneStrategy(BaseStrategy):
             # FIXME(sirp): for now just using the first endpoint we get back
             # from the service catalog for glance, and using the public url.
             for service in resp_auth['serviceCatalog']:
- if service['name'] == 'glance':
+ if service['type'] == 'image-service':
                     glance_endpoint = service['endpoints'][0]['publicURL']

compare the equivalent swift bug:

Stuart McLaren (stuart-mclaren) wrote :

Note, that in the keystone source they seem to refer to glance
as both of type 'image' and 'image-service':


    #6 Service Name:glance Type:image
    ('service', 'add', 'glance',
        'image', 'OpenStack Image Service'),


            <enumeration value="image-service">
                            The type for a Glance-compatible service

My guess is that 'image-service' is the right type?

Jay Pipes (jaypipes) wrote :

Use whatever Nova is set to... if it's compute, then use image, if it's compute-service, I'd use image-service.


Changed in glance:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Stuart McLaren (stuart-mclaren)
milestone: none → essex-3
tags: added: diablo-backport
tags: added: keystone
Stuart McLaren (stuart-mclaren) wrote :

From the keyston api doc it seems Nova is just 'compute':

        "name":"Cloud Servers",

from the keystone tests that also seems to be the case:

 "type": "compute",

So I will set glance to look for 'image'.

Jay Pipes (jaypipes) wrote :

Hi Stu, is this in progress?

Donagh McCabe (donagh-mccabe) wrote :

> So I will set glance to look for 'image'

Wrt #2 and #3, as per keystone/blob/master/keystone/content/common/xsd/services.xsd, glance should be "image-service", not "image". Project/type mapping is:

Nova compute (not "compute-service")
Glance image-service (not "image")
Swift object-store
Keystone identity

> Stu, is this in progress?
Stuart is on vacation so it will be a couple of weeks before you see anything from him

Jay Pipes (jaypipes) wrote :

Hi Donagh, thanks for the heads up on Stuart :)

re: the name of the service, I think I would prefer "image" over "images" to align with the rest of the service names (none of the others have -service attached to them.) Lemme chat with Ziad and see if we can get that aligned in Keystone.


Jay Pipes (jaypipes) on 2012-01-24
Changed in glance:
milestone: essex-3 → essex-4

Fix proposed to branch: master

Changed in glance:
status: Confirmed → In Progress

Submitter: Jenkins
Branch: master

commit 28f2cae1612b1dbd854fa45859ac46c995b0d5d1
Author: Stuart McLaren <email address hidden>
Date: Mon Jan 30 14:09:09 2012 +0000

    Check service catalogue type rather than name

    Fix for bug 904850. After authenticating with Keystone select
    the 'type' field from the returned ServiceCatalog json rather
    than the 'name'.

    Change-Id: I4e3d92a1ff58fa2be1669789fe371f61c53f652a

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-02-29
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in glance:
milestone: essex-4 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers