Skip to content

Launch Horizon (Openstack dashboard) from scratch

chixq edited this page Oct 20, 2014 · 3 revisions

TL;DR Fuck the ReadMe below horizon git repo, step by step in this article if you came into some troubles before 😄

Tai Chi: Please git clone the openstack/horizon

Prepare

1thing you have to do (no matter you tried to launch horizon or not, -f means everything from ever begining)

$ (sudo) tools/with_env.sh ./run_tests.sh -f 

Wait a few minutes for virtualenv's provisioning (everything should be prepared under .venv/)

if you came into error below:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: ordinal not in range(128) 

Please apt-get install python-dev (Ubuntu) or yum install python-devel(Centos/Fedora)

Run the Demo

After virtual env provison, you can test to start the demo Dashboard

$ cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
$ (sudo) tools/with_env.sh manager.py runserver localhost:9000

PS. $ source .ven/active if you dont want to type tools/with_venv.sh everytime to run command in virtual ENV.

Unsurprisingly, you may access the dashboard via http://localhost:9000, but you cannot login with any User/Pass alternatives. It always prompt "Failed to authenticate/Wrong Username" or something else.

Because, you dont set up keystone and make horion to work on it. Here is some offical guide on setting up keystone and configuration, but I want to name it directly.It's easy.

Setting up Keystone

Install keystone and configure service endpoint.

If you're running Ubuntu:

$ (sudo) apt-get install keystone
Check tenant, find openstack tenant definition [here][tenant]
$ keystone tenant-list
Come into some error?
$ export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0 #Keystone adminUrl by default
$ export OS_SERVICE_TOKEN="ADMIN"  # Openstack-horizon token by default

Register Keystone as service

$ keystone service-create --name=keystone --type=identity --description "Identify Service"
$ keystone service-list
+----------------------------------+----------+----------+------------------+
|                id                |   name   |   type   |   description    |
+----------------------------------+----------+----------+------------------+
| d1d43aa2ef7c4971af90e9cbff6e2643 | keystone | identity | Identity Service |
+----------------------------------+----------+----------+------------------+
$ keystone endpoint-create \
 --region RegionOne \
 --service-id=d1d43aa2ef7c4971af90e9cbff6e2643 \
 --publicurl=http://localhost:5000/v2.0 \
 --internalurl=http://localhost:5000/v2.0 \
 --adminurl=http://localhost:35357/v2.0

Create tenants(users) for openstack-horizon

$ keystone tenant-create --name=admin
+----------------------------------+-------+---------+
|                id                |  name | enabled |
+----------------------------------+-------+---------+
| b4ceb1c93ceb4bbeb5f0d43a4d843786 | admin |   True  |
+----------------------------------+-------+---------+
$ keystone user-create --tenant-id b4ceb1c93ceb4bbeb5f0d43a4d843786 --name admin --pass admin

Till now, you can restart openstack horizon demo, and login as admin/admin