Ask Your Question

What is %(tenant_id)s in keystone endpoints

asked 2013-12-20 02:32:50 -0500

laocius gravatar image

In the tutorial from says keystone endpoints should be set to something like http://HOST_IP:8774/v2/%25(tenant_id)s (http://HOST_IP:8774/v2/%(tenant_id)s) what does '%(tenant_id)s' here mean? Because in a lot of forums, I saw the endpoints are something like http://HOST_IP:8774/v2/$(tenant_id)s What does this '%' and '$' mean here; even, someone suggests to set endpoints exactly as http://HOST_IP:8774/v2.0 .

I am very confused. How does keystone resolve this tenant_id?



edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-12-20 08:55:58 -0500

jtopjian gravatar image

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=""
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 = OpenStack Compute Service
catalog.RegionOne.compute.publicURL =
catalog.RegionOne.compute.adminURL =
catalog.RegionOne.compute.internalURL =

Now I'll run the following commands:

$ source openrc
$ keystone catalog --service=compute

And here are the results:

Service: compute
|   Property  |                               Value                               |
|   adminURL  | |
| internalURL | |
|  publicURL  | |
|    region   |                                  RegionOne                        |

Hope that helps,


edit flag offensive delete link more


Thanks Joe.

laocius gravatar imagelaocius ( 2013-12-23 01:28:42 -0500 )edit

answered 2015-10-05 04:14:01 -0500

Matt G gravatar image

I believe % is in the endpoints returned by Keystone v2 and $ is in the endpoints returned by Keystone v3.

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


Asked: 2013-12-20 02:32:50 -0500

Seen: 3,929 times

Last updated: Dec 20 '13