[Steps summarised from http://docs.openstack.org/grizzly/openstack-compute/admin/content/adding-users-tenants-and-roles-with-python-keystoneclient.html]
Pre-requisite
Run steps from link http://itinsteps.blogspot.in/2014/06/steps-to-setup-openstack-command-line.html to setup command line tools for OpenStack.
Set the environment for OpenStack Administrator User
# source ~/keystonerc_admin
List all existing roles
# keystone role-list
Create new tenant or project
# keystone tenant-create --name=<tenant-name>
List all tenants in OpenStack
# keystone tenant-list
Create User for OpenStack
# keystone user-create --name=<user-name> --pass=<password> --email=<user-email-address>
Assign User to a tenant as a particular role
# keystone user-role-add --user=<user-name> --tenant=<tenant-name> --role=<admin or _member_>
List all existing users
# keystone user-list
Create rc file for setting environment for new user
# vi ~/keystonerc_<user-name>
export OS_USERNAME=<user-name>
export OS_TENANT_NAME=<tenant-name>
export OS_PASSWORD=<password>
export OS_AUTH_URL=http://<openstack-controller-IP>:5000/v2.0/
export PS1='[\u@\h \W(keystone_<user-name>)]\$ '
Set the environment for OpenStack New User
# source ~/keystonerc_<user-name>
Great blog and is very helpful for all users want to create new OpenStack tenant or user. Thanks for providing useful info.
ReplyDelete