Ask Your Question
1

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 http://192.168.6.72:8774/v2/**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 delete

1 answer

Sort by » oldest newest most voted
0

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

jtopjian gravatar image

The URL must be:

http://192.168.6.72:8774/v2/**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 publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Stats

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

Seen: 95 times

Last updated: Dec 23 '13