Ask Your Question

How do I add a keypair for a normal tenant using admin user credentials?

asked 2013-11-28 07:29:22 -0500

Saurabh Chakrabarti gravatar image

updated 2013-11-29 16:55:47 -0500

smaffulli gravatar image

I'm trying to create a key-pair using REST api's for nova. My requirement is to create a key-pair for tenantA(non-admin tenant) from admin.

I tried adding the tenant_id of tenantA in the create keypair body :

 curl -k -X 'POST' -v**admin_tenant_id**/os-keypairs -d '{"keypair": {"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDqYczUOi...7IrVMXpljdDRkV6uqnG0n/5caT root@os-ctrl-72\n", "name": "hello", **"tenant_id": tenantA_id**}}' -H 'x-auth-token:**admin-token**' -H 'content-type: application/json'

What happens here is that it creates a keypair with the name "hello" for admin-tenant and not for tenantA.

Please help me with creating a keypair for a non-admin tenant with admin credentials. Any help is appreciated!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-12-23 10:41:17 -0500

jtopjian gravatar image

The URL must be:**tenantA_id**/os-keypairs

If you are unable to use this URL as-is, then the admin user needs to be added to tenantA using something like:

keystone user-role-add --user admin --tenant tenantA --role admin
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2013-11-28 07:29:22 -0500

Seen: 1,019 times

Last updated: Dec 23 '13