Book Image

OpenStack Cloud Computing Cookbook

By : Egle Sigler, Kevin Jackson, Cody Bunch
Book Image

OpenStack Cloud Computing Cookbook

By: Egle Sigler, Kevin Jackson, Cody Bunch

Overview of this book

Table of Contents (19 chapters)
OpenStack Cloud Computing Cookbook Third Edition
About the Authors
About the Reviewers

Installing the OpenStack Identity Service

We will be performing an installation and configuration of the OpenStack Identity service, known as Keystone, using the Ubuntu Cloud Archive. Once configured, connecting to our OpenStack cloud environment will be performed through our new OpenStack Identity service.

The backend datastore for our OpenStack Identity service will be a MariaDB database. The environment we will be installing is shown in the following figure. In this chapter, we will be concentrating on the Controller host.

Getting ready

To ensure that we're running the Ubuntu Cloud Archive, we must first configure our Ubuntu 14.04 installation to use this service. For more information, visit


All of the steps can be found at

We will configure Keystone to use MariaDB as the database backend, so this needs to be installed prior to installing Keystone.


If MariaDB is not installed, visit for instructions on how to do this.

Ensure that you have a suitable server available for installation of the OpenStack Identity service components. If you are using the accompanying Vagrant environment, as described in the Preface, this will be the controller node.

Make sure that you are logged in to the controller node and ensure that it has Internet access to allow us to install the required packages in our environment for running Keystone. If you created this node with Vagrant, you can execute the following command:

vagrant ssh controller

The instructions here assume that the controller node has two IP addresses. It will have a front-facing IP address,, and a backside IP address,, (which is also the address of the MariaDB server). The reason it has two addresses is that internal data will communicate over the backside IP address (for example, database traffic), and any Keystone traffic will traverse the front.

How to do it...

Carry out the following instructions to install the OpenStack Identity service:

  1. Installation of the OpenStack Identity service is done by specifying the Keystone package in Ubuntu, and we do this as follows:

    sudo apt-get update
    sudo apt-get install ntp keystone python-keyring
  2. Once installed, we need to configure the backend database store, so we first create the keystone database in MariaDB. We do this as follows (here, we have a user in MariaDB called root with the password openstack, which can create databases):

    mysql -uroot -p$MYSQL_ROOT_PASS -e "CREATE DATABASE \
  3. It is good practice to create a user that is specific to our OpenStack Identity service, so we create a Keystone user in the database as follows:

    mysql -uroot -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON \keystone.* TO 'keystone'@'localhost' IDENTIFIED BY \'$MYSQL_KEYSTONE_PASS';"
    mysql -uroot -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON \keystone.* TO 'keystone'@'%' IDENTIFIED BY \'$MYSQL_KEYSTONE_PASS';"
  4. We then need to configure the OpenStack Identity service by editing the /etc/keystone/keystone.conf file to have the following content:

    admin_token = ADMIN
    connection = mysql://keystone:[email protected]/keystone
    Distribution = Ubuntu
    use_syslog = True
    syslog_log_facility = LOG_LOCAL0
  5. We can now restart the keystone service to pick up these changes:

    sudo stop keystone
    sudo start keystone
  6. With keystone started, we can now populate the keystone database with the required tables by issuing the following command:

    sudo keystone-manage db_sync

Congratulations! We have now installed the OpenStack Identity service and it is ready for use in our OpenStack environment.

How it works...

A convenient way to install the OpenStack Identity service in our OpenStack environment is by using the Ubuntu packages. Once installed, we configure our MariaDB database server with a keystone database and set up the keystone.conf configuration file with the corresponding values. After starting the Keystone service, running the keystone-manage db_sync command populates the keystone database with the appropriate tables ready for us to add in the required users, roles, and tenants required in our OpenStack environment.