OpenStack Introduction for Ubuntu Part III

This is the third Post about Open Stack Introduction. The first part of this post series is about general concepts, basic configuration and Identity service installation , the second part one continue with Image and Compute services. This part is about dashboard and block storage configuration. At this link a complete installation guide can be found.

Install the Dashboard

The dashboard is a web interface that enables cloud administrators and users to manage various OpenStack resources and services. The dashboard enables web-based interactions with the OpenStack Compute cloud controller through the OpenStack APIs.

Install apache server and the dashboard on the node that can contact the Identity Service as root :

   # apt-get install apache2 libapache2-mod-wsgi  memcached  openstack-dashboard 
   # apt-get remove --purge openstack-dashboard-ubuntu-theme 

Modify the value of CACHES['default']['LOCATION'] in /etc/openstack-dashboard/local_settings.py to match the ones set in /etc/memcached.conf

   CACHES = {
    'default': {
        'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION' : '127.0.0.1:11211'
        }
    }

Update the ALLOWED_HOSTS in local_settings.py to include the addresses you wish to access the dashboard from

   ALLOWED_HOSTS = ['localhost', 'my-desktop'] 
   OPENSTACK_HOST = "controller" 

You can now access the dashboard at http://controller/horizon . Login with credentials for any user that you created with the OpenStack Identity Service.

Add the Block Storage Service

The OpenStack Block Storage Service works though the interaction of a series of daemon processes named cinder-* that reside persistently on the host machine or machines. You can run the binaries from a single node or across multiple nodes. You can also run them on the same node as other OpenStack services.

Block Storage Service

The Block Storage Service enables management of volumes, volume snapshots, and volume types. It includes the following components:

  • cinder-api: Accepts API requests and routes them to cinder-volume for action.
  • cinder-volume: Responds to requests to read from and write to the Block Storage database.
  • cinder-scheduler daemon: Picks the optimal block storage provider node on which to create the volume.
  • Messaging queue: Routes information between the Block Storage Service processes.

Configure a Block Storage Service controller

Install packages

   # apt-get install cinder-api cinder-scheduler 

Configure Block Storage to use your MySQL database. Edit the /etc/cinder/cinder.conf file and add the following key under the [database] section

   [database]
    ...
    connection = mysql://cinder:CINDER_DBPASS@controller/cinder 

Create database and user

# mysql -u root -p mysql> CREATE DATABASE cinder; mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \ IDENTIFIED BY 'CINDER_DBPASS'; mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \ IDENTIFIED BY 'CINDER_DBPASS';

Create tables

   # cinder-manage db sync 

Create a keystone cinder user

   # keystone user-create --name=cinder --pass=CINDER_PASS --email=cinder@example.com
    +----------+----------------------------------+
    | Property |              Value               |
    +----------+----------------------------------+
    |  email   |        cinder@example.com        |
    | enabled  |               True               |
    |    id    | ff2562ccad9d490aaf214e5e5e063186 |
    |   name   |              cinder              |
    +----------+----------------------------------+
   
   # keystone user-role-add --user=cinder --tenant=service --role=admin 

Add the credentials to the file /etc/cinder/api-paste.ini on the section [filter:authtoken]

    [filter:authtoken]
    paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory
    auth_host=controller
    auth_port = 35357
    auth_protocol = http
    auth_uri = http://controller:5000
    admin_tenant_name=service
    admin_user=cinder
    admin_password=CINDER_PASS

Configure Block Storage to use the RabbitMQ message broker by setting these configuration keys in the [DEFAULT] configuration group of the /etc/cinder/cinder.conf file

   [DEFAULT]
    ...
    rpc_backend = cinder.openstack.common.rpc.impl_kombu
    rabbit_host = controller
    rabbit_port = 5672
    rabbit_userid = guest
    rabbit_password = RABBIT_PASS 

Register the Block Storage Service with the Identity Service so that other OpenStack services can locate it.

   # keystone service-create --name=cinder --type=volume --description="Cinder Volume Service" 
    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    | description |      Cinder Volume Service       |
    |      id     | 5f4ac31dd0334c9d89e72375f165c26d |
    |     name    |              cinder              |
    |     type    |              volume              |
    +-------------+----------------------------------+

Use id property to create the endpoint

   # keystone endpoint-create \
  --service-id=the_service_id_above \
  --publicurl=http://controller:8776/v1/%\(tenant_id\)s \
  --internalurl=http://controller:8776/v1/%\(tenant_id\)s \
  --adminurl=http://controller:8776/v1/%\(tenant_id\)s 

Register a service and endpoint for version 2 of the Block Storage Service API.

   # keystone service-create --name=cinderv2 --type=volumev2 \
  --description="Cinder Volume Service V2" 

    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    | description |     Cinder Volume Service V2     |
    |      id     | 46d56ead76f94608b5ff8432b156b865 |
    |     name    |             cinderv2             |
    |     type    |             volumev2             |
    +-------------+----------------------------------+

Register endpoint

       # keystone endpoint-create \
  --service-id=the_service_id_above \
  --publicurl=http://controller:8776/v2/%\(tenant_id\)s \
  --internalurl=http://controller:8776/v2/%\(tenant_id\)s \
  --adminurl=http://controller:8776/v2/%\(tenant_id\)s 

Restart the cinder service

   # service cinder-scheduler restart
   # service cinder-api restart 

Configure a Block Storage Service node

We will setup a new node that will contain the disk that serves volumes, update /etc/hosts in controller and in the new node:

    127.0.0.1       localhost
    192.168.0.10    controller
    192.168.0.11    compute1
    192.168.0.12    block1

Install the required LVM packages in the block1 node

   # apt-get install lvm2 

Create the LVM physical and logical volumes. This guide assumes a second disk /dev/sdb that is used for this purpose

    # pvcreate /dev/sdb
    # vgcreate cinder-volumes /dev/sdb 

Add a filter entry to the devices section /etc/lvm/lvm.conf to keep LVM from scanning devices used by virtual machines. Each item in the filter array starts with either an a for accept, or an r for reject. The physical volumes that are required on the Block Storage host have names that begin with a. The array must end with "r/.*/" to reject any device not listed. In this example, /dev/sda1 is the volume where the volumes for the operating system for the node reside, while /dev/sdb is the volume reserved for cinder-volumes.

   devices {
    ...
    filter = [ "a/sda1/", "a/sdb/", "r/.*/"]
    ...
    } 

Install the appropriate packages for the Block Storage Service on block1 node

   # apt-get install cinder-volume 

Edit /etc/cinder/api-paste.ini , locate the section [filter:authtoken]:

   [filter:authtoken]
    paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory
    auth_host=controller
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name=service
    admin_user=cinder
    admin_password=CINDER_PASS 

Configure Block Storage to use the RabbitMQ message broker by setting these configuration keys in the [DEFAULT] configuration group of the /etc/cinder/cinder.conf file

   [DEFAULT]
    ...
    rpc_backend = cinder.openstack.common.rpc.impl_kombu
    rabbit_host = controller
    rabbit_port = 5672
    rabbit_userid = guest
    rabbit_password = RABBIT_PASS 

Configure Block Storage to use your MySQL database. Edit the /etc/cinder/cinder.conf

   [database]
    ...
    connection = mysql://cinder:CINDER_DBPASS@controller/cinder 

Configure Block Storage to use the Image Service. Edit the /etc/cinder/cinder.conf file and update the glance_host option in the [DEFAULT] section:

[DEFAULT]
...
glance_host = controller

Restart the cinder service:

   # service cinder-volume restart
   # service tgt restart