Tango with code

A blog about frustration and anger

How to Install Sahara and Sahara Dashboard on OpenStack Newton (Ubuntu)

| Comments

Last week I was trying to install Sahara following link avaiable in OpenStack page, but it seemed kinda outdated, and thus I faced several problems due to API compatibility. So here I’ll try to explain how to install it in a more thoroughly approach and point some pitfalls that may happen.

First of all, Sahara has the following requirements:

  • Keystone
  • Nova
  • Neutron
  • Glance
  • Heat
  • Cinder

I’m going to assume that you have all of them already installed and running properly!

Installing Sahara

— Note: Replace controller by the IP address of your controller node.

Let’s install Sahara and its python binding to the OpenStack client (it enables you to use openstack dataprocessing …):

1
sudo apt-get install sahara python-saharaclient

At first it will prompt you to input some configurations. You don’t need to mind them right now. Just leave them as default.

Now create a new service named data-processing so the dashboard can make requests to Sahara.

1
openstack service create --name sahara --description "Sahara Data Processing" data-processing

Create the endpoints in order to communicate with the Sahara API.

1
2
3
openstack endpoint create --region RegionOne data-processing public http://controller:8386/v1.1/%\(project_id\)s;
openstack endpoint create --region RegionOne data-processing internal http://controller:8386/v1.1/%\(project_id\)s;
openstack endpoint create --region RegionOne data-processing admin http://controller:8386/v1.1/%\(project_id\)s;

Create a user named sahara and add it to the service project.

1
2
openstack user create --domain default --password SAHARA_PASS sahara;
openstack role add --project service --user sahara admin

Replace SAHARA_PASS by a proper password.

Now login to mysql and create a new database so the Sahara can use it.

1
mysql -u root -p
1
2
CREATE DATABASE sahara;
GRANT ALL ON sahara.* TO 'sahara'@'%' IDENTIFIED BY 'SAHARA_DBPASS';

Replace SAHARA_DBPASS by a proper password.

Now open the configuration file /etc/sahara/sahara.conf and edit:

  • In the section [DEFAULT], add:
1
2
3
4
transport_url = rabbit://openstack:RABBIT_PASS@controller
use_neutron = true
use_floating_ips = false
heat_enable_wait_condition = false

Replace openstack by the RabbitMQ username and RABBIT_PASS by the RabbitMQ password.

  • In [DATABASE]:
1
connection = mysql://sahara:SAHARA_DBPASS@controller/sahara

Replace SAHARA_DBPASS by the password you set previously.

  • In [keystone_authtoken]:
1
2
3
4
5
6
auth_uri = http://controller:5000/v3/
identity_uri = http://controller:35357/
memcached_servers = controller
admin_user = sahara
admin_password = SAHARA_PASS
admin_tenant_name = service

Replace SAHARA_PASS by the password you set previously.

Save and close the file.

Now in /etc/mysql/my.cnf, edit:

1
2
[mysqld]
max_allowed_packet = 256M

Restart MySQL.

1
sudo service mysql restart

Populate the database.

1
sudo sahara-db-manage --config-file /etc/sahara/sahara.conf upgrade head

Important step! The new neutron version doesn’t support floating ips. Hence, when Sahara go check the limits of floating ips of your network, it will prompt an Internal Error due to “Resource not found”. Disable floating ips calls on Sahara API.

Edit the file /usr/lib/python2.7/dist-packages/sahara/service/quotas.py.

Comment lines 152-153. Add a new line right below:

1
limits['floatingips'] = 0

Comment lines 171-174. Add a new line right below:

1
limits['floatingips'] = 0

Restart the Sahara services.

1
2
sudo service sahara-api restart;
sudo service sahara-engine restart

Installing Sahara Dashboard

Certify your Horizon is working properly!

Install it through pip:

1
sudo pip install 'http://tarballs.openstack.org/sahara/sahara-stable-newton.tar.gz'

The Developer dashboard is disabled by the default on Horizon. You need to enable it before installing Sahara dashboard, orelse an error like this could happen:

1
Dashboard with slug "developer" is not registered

(Took me hours to discover this. Damn!)

To do it, edit /usr/share/openstack-dashboard/openstack_dashboard/settings.py, and set:

1
DEBUG = true

Do the same to /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py.

In /etc/openstack-dashboard/local_settings.py, add:

1
2
DEBUG = True
SAHARA_USE_NEUTRON = True

Now install the dashboard.

1
sudo cp /usr/local/lib/python2.7/dist-packages/sahara_dashboard/enabled/* /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/

Compress the new assets.

1
sudo python /usr/share/openstack-dashboard/manage.py compress

Restart Apache.

1
sudo service apache2 restart

Check if a new dashboard appeared under the Project tab.

Comments