Ask Your Question

Revision history [back]

I think the % and $ are interchangeable.

%(tenant_id)s is a placeholder for the tenant_id of the user who is accessing the Keystone catalog. If you run the command keystone catalog, Keystone will return its service catalog but you'll notice that all occurrences of %(tenant_id)s have been replaced with the actual ID of the tenant.

Keystone resolves the tenant_id by using the environment variables you specified either on the command line or in an openrc file:

$ cat openrc
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD="password"
export OS_AUTH_URL="http://cloud.example.com:5000/v2.0/"
export OS_AUTH_STRATEGY=keystone
export OS_REGION_NAME=RegionOne

For example, here is my "Compute" service entry in /etc/keystone/default_catalog.templates:

# RegionOne/compute
catalog.RegionOne.compute.name = OpenStack Compute Service
catalog.RegionOne.compute.publicURL = http://cloud.example.com:8774/v2/%(tenant_id)s
catalog.RegionOne.compute.adminURL = http://cloud.example.com:8774/v2/%(tenant_id)s
catalog.RegionOne.compute.internalURL = http://cloud.example.com:8774/v2/%(tenant_id)s

Now I'll run the following commands:

$ source openrc
$ keystone catalog --service=compute

And here are the results:

Service: compute
+-------------+-------------------------------------------------------------------+
|   Property  |                               Value                               |
+-------------+-------------------------------------------------------------------+
|   adminURL  | http://cloud.example.com:8774/v2/00cb7ac024214aaf9df2f179452c8121 |
| internalURL | http://cloud.example.com:8774/v2/00cb7ac024214aaf9df2f179452c8121 |
|  publicURL  | http://cloud.example.com:8774/v2/00cb7ac024214aaf9df2f179452c8121 |
|    region   |                                  RegionOne                        |
+-------------+-------------------------------------------------------------------+

Hope that helps,

Joe