Home  >  Blog  >   OpenStack  > 

Create Tenant Users and Roles in OpenStack

Users reside within Tenants and are granted permissions by virtue of the Roles that have been assigned to them. OpenStack's Identity service is in charge of all of these details and more. As part of this blog series, we will look about how to develop tenants for users.

Rating: 4
  1. Share:
OpenStack Articles

Creating OpenStack tenant

In OpenStack we have several projects where ‘tenant’ is one of them, which is a must for the users and hence is assigned to them. In the following section, let us learn how to create tenant for our users termes as ‘cookbook’.
Getting Started
First of all, assure that you have logged into our OpenStack Controller host— where OpenStack Identity service has been installed
To log  into an OpenStack Controller host that has been  created using Vagrant, subject the following command:
vagrant ssh controller
If the keystoneclient tool is not accessible, then it can be installed in an Ubuntu client by declaring the following command say,
sudo apt-get update
sudo apt-get -y install python-keystoneclient
Also make sure that our environment has been kept correctly to access our OpenStack environment for organizational objectives:
export ENDPOINT = 1172.16.172.200
SERVICE_ENDPOINT = https:// ${ ENDPOINT}: 35357/v2.0
To gain in-depth knowledge and be on par with practical experience, then explore  OpenStack Training course.
How to carry it out…
To create a tenant in our OpenStack environment, perform the following procedure:
1. To Create a tenant called cookbook, do as follows:
keystone tenant-create
–name cookbook
–description “Default Cookbook Tenant”
–enabled true
This entire intput result in an output as below:
Property Value
DescriptionEnable Default Cookbook TenantTrue
Id 8ec8e07a759e46d2abb316ee368d0e5b
Name cookbook
2. We must also create another important tenant called ‘admin tenant’, so that all our users can have access to the complete environment available. We achieve it in the similar fashion as above:
keystone tenant-create
–name cookbook
–description “Admin Tenant”
–enabled true
MindMajix YouTube Channel
Explore OpenStack Sample Resumes! Download & Edit, Get Noticed by Top Employers!  Download Now!
How it works…
Roles can be created by simply using the keystone client, by specifying the tenant-create option with the help of following syntax:
keystone tenant-create
–name tenant_name
–description “A description”
–enabled true
The tenant_name is an arbitrary string and hence should not have any spaces. After the completion of creation of tenant we get an ID, which can be used to add further users to this tenant. If you wish to see the list of tenants and the assosciated ID’s in our environment, then we can issue a command as below:
keystone tenant-list

Related Pages:
Openstack Tutorial

Interview Questions:
Openstack Interview Questions


Join our newsletter

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
OpenStack TrainingJun 03 to Jun 18
OpenStack TrainingJun 06 to Jun 21
OpenStack TrainingJun 10 to Jun 25
OpenStack TrainingJun 13 to Jun 28
Last updated: 02 June 2023
About Author
Remy Sharp
Ravindra Savaram

Ravindra Savaram is a Content Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

Recommended Courses

1 /15