Using OpenStack Dashboard to add new tenants
Tenants are known as Projects within the OpenStack Dashboard. Adding new tenants that users can be members of is achieved quite simply in OpenStack Dashboard. For a VLAN managed environment, it also involves assigning an appropriate private network to that new tenant by using the console. To do this, we must log into OpenStack Dashboard as a user with admin privileges and also log in to Shell on our OpenStack Controller API server.
Load a Web browser, point it to our OpenStack Dashboard address at http://172.16.0.200/horizon, and log in as a user, such as the demo user created in Adding users recipe of Keystone OpenStack Identity Service, with the password openstack.
If using the VLAN Manager under Nova network, we need to run some commands to tie our VLAN private networks to our tenants as this isn’t possible under the OpenStack Dashboard. To do this, log on to a shell on our Controller host. If this was created using Vagrant run the following command:
vagrant ssh controller
How to achieve it…
To add a new tenant to our OpenStack environment, carry out the following steps:
- When we log in as a user with admin privileges, an extra tab called Admin appears. Clicking on this tab shows the System Panel options. This tab allows us to configure our OpenStack environment as shown in the following screenshot:
- To manage tenants, click on the Projects option listed under the System Panel. This will list the available tenants in our environment as shown in the following screenshot:
- To create a new tenant, click on the Create Project.
- Next, we are presented with a form that asks for the name of the tenant and a description. Enter horizon as our tenant, and enter a description:
- Ensure that the tenant is enabled by selecting the Enabled checkbox, and then click on the Create Project.
- We will be presented with the list of tenants that are now available and a message saying that the horizon tenant was created successfully and asking us to make a note of the new Tenant ID.
Only for a VLAN managed network
If our OpenStack environment has been set up by using the VLAN Manager in /etc/nova/nova.conf (the default when nothing is specified), run the following command in the Shell on our OpenStack Controller server:
sudo nova-manage network create \ --label=horizon \ -- num_networks=1 \ -- network_size=64 \ --vlan=101 \ --bridge_interface=eth2 \
--project_id=75f386f48e77479f9a5c292b9cf8d4ec \ --fixed_range_v4=10.2.0.0/8
This creates an IP range on a specific VLAN that we have associated with our horizon tenant. Once successful, our new tenant is available to use.
How it works…
OpenStack Dashboard is a feature rich interface that complements the command-line options available to you when managing our OpenStack environment. This means we can simply create a tenant (Ubuntu’s interface refers to this a project), to which users can belong to, within OpenStack Dashboard.
When creating new tenants under a VLAN Manager configured OpenStack network, we assign an IP address range and specific VLAN ID to this tenant. If we assign a new VLAN, please ensure you configure your hardware switches accordingly, so that the private network can communicate by using this new VLAN ID. Note that we use the following parameters with nova-manage, the command used when configuring a network to match our new tenant:
What we have done is, named this private network appropriately, matching our tenancy. We have created a new VLAN so that traffic is encapsulated in a new VLAN, separating this traffic from other tenants. We finally specified the ID of the tenancy that was returned when we created the tenant through OpenStack Dashboard.