Tenant and user management

The first task will be to create the new tenant/project in Keystone and add the users, Jane and John Doe, as users and members. We will also be adding our admin account as an admin on the new tenant, so we can support them in the future.

We can perform these actions in two ways, the command line and the GUI; you can choose either of the methods depending on your preference (please remember that only one of them needs to be followed).

GUI

Log in to Horizon, by going to http://<controllernodeIP>/horizon, which in our case is http://172.22.6.95/horizon. Authenticate using the admin credentials that we have been using, admin/h33l0world

Creating the project

To create the project, follow these steps:

  1. Click on Identity | Projects (On the left pane)

    You would already see the existing tenants, admin and service tenant that we created in the beginning.

  2. Now click on Create Project, as seen in the following screenshot:

    Tip

    Please see the chapter on Keystone; projects and tenants are interchangeably used.

    Creating the project
  3. We can modify the quota for this project by going to the Quota tab, but since the project manager was fine with the defaults, we don't update the values. Click on Create Project.

    The project is now created, as shown here:

    Creating the project

Adding users

To add users, follow these steps:

  1. Navigate to Identity | Users.
  2. You should be able to see the currently created admin and the service users; let's click on Create User, and then we can create the accounts for Jane Doe and John Doe and give them the password, Pa55word. We will also associate them with a new tenant and give them member permissions.
    Adding users

Repeat the preceding steps for the second user, and now both the users have been created in the system.

Associating users to the project

The users that we have created are already associated with the project as members, but we need to add our admin user as an admin to the project, and potentially other users that were created before could be added by this method, or we can change the role mapping of the user using this method. To do this, follow these steps:

  1. Click on Identity | Projects and click on Modify Users.
    Associating users to the project
  2. Click on + next to the admin user, and it will be added to the right-hand side. You can then choose the roles. We choose both the admin and member roles for this user.
    Associating users to the project

We can choose to give more roles to Jane and John from this screen, or remove them from the project.

So, the first part of setting up the project is done. You can test this by logging out of the portal and logging in as Jane or John, as shown in the following screenshot:

Associating users to the project

If a user is assigned to multiple projects, they can change the current project from the top of the screen as shown in the previous screenshot.

CLI

In order to do the same things we did using the GUI while using the CLI, all it takes is a bunch of commands:

Tip

If you have already created the users and project using GUI, then this is just for your information and need not be followed.

We log in to the controller node, and as with all the CLI commands, we export the authentication parameters in the command line using the source command or individually using the export command. We have stored it in the os.txt file in our home folder.

source ~alokas/os.txt

Creating the project

To create a project, we execute the create tenant command:

keystone tenant-create --name TestingCloud --description ""

Note

Remember that the tenant and the project are interchangeable.

This should create the project.

Creating the users

We create the users in the project using the user-create command:

keystone user-create --name johnd --pass Pa55word  --email [email protected]
keystone user-create --name janed --pass Pa55word  --email [email protected]

Associating users to the roles

We now associate the users to the tenant and map them to the member roles, using the following commands:

keystone user-role-add --user johnd --tenant TestingCloud --role member
keystone user-role-add --user janed --tenant TestingCloud --role member
keystone user-role-add --user admin --tenant TestingCloud --role admin
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset