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.

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
export SERVICE_TOKEN = ADMIN
export
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:
PropertyValue
DescriptionEnableDefault Cookbook TenantTrue
Id8ec8e07a759e46d2abb316ee368d0e5b
Namecookbook
 
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

 

Job Support Program

Online Work Support for your on-job roles.

jobservice

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreGet Job Support
Course Schedule
NameDates
OpenStack TrainingNov 23 to Dec 08View Details
OpenStack TrainingNov 26 to Dec 11View Details
OpenStack TrainingNov 30 to Dec 15View Details
OpenStack TrainingDec 03 to Dec 18View Details
Last updated: 28 Sep 2024
About Author

Ravindra Savaram is a Technical 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.

read less
  1. Share:
OpenStack Articles