Difference between revisions of "OpenStackDashboard"
(added corrections about user credentials and building django-nova being optional from devcamcar) |
(just styling changes) |
||
Line 6: | Line 6: | ||
To view a quick video tour of the dashboard in action, please see this [http://blog.rabbityard.com/post/2937203639/openstack-dashboard-video blog post]. | To view a quick video tour of the dashboard in action, please see this [http://blog.rabbityard.com/post/2937203639/openstack-dashboard-video blog post]. | ||
− | = Prerequisites for Running The [[OpenStack]] Dashboard = | + | == Prerequisites for Running The [[OpenStack]] Dashboard == |
* Running [[OpenStack]] nova instance (nova-api and nova-compute) with EC2 API enabled | * Running [[OpenStack]] nova instance (nova-api and nova-compute) with EC2 API enabled | ||
Line 13: | Line 13: | ||
* python 2.6 (not tested with python 3.0) | * python 2.6 (not tested with python 3.0) | ||
− | = Installation Overview = | + | == Installation Overview == |
The overall steps for building the dashboard are: | The overall steps for building the dashboard are: | ||
Line 25: | Line 25: | ||
These instructions are for a '''test''' openstack-dashboard deployment. They configure your dashboard to use a sqlite3 database and the default django server. To create a more robust installation, you should configure this with an Apache webserver and MySQL/Postgres database. | These instructions are for a '''test''' openstack-dashboard deployment. They configure your dashboard to use a sqlite3 database and the default django server. To create a more robust installation, you should configure this with an Apache webserver and MySQL/Postgres database. | ||
− | = Get The Source = | + | == Get The Source == |
To prevent any interruption to our hacking, let's grab all the code that we need. | To prevent any interruption to our hacking, let's grab all the code that we need. | ||
− | == Create Your Source Directory == | + | === Create Your Source Directory === |
Line 38: | Line 38: | ||
− | == Get django-nova == | + | === Get django-nova === |
django-nova is the reference implementation of the openstack dashboard. This module contains almost all of the real code of the website. | django-nova is the reference implementation of the openstack dashboard. This module contains almost all of the real code of the website. | ||
Line 52: | Line 52: | ||
You should now have a directory called trunk, which contains the reference implementation. | You should now have a directory called trunk, which contains the reference implementation. | ||
− | == Get openstack-dashboard == | + | === Get openstack-dashboard === |
openstack-dashboard provides all the look and feel for the dashboard. | openstack-dashboard provides all the look and feel for the dashboard. | ||
Line 67: | Line 67: | ||
You should now have a directory called trunk, which contains the [[OpenStack]] Dashboard application. | You should now have a directory called trunk, which contains the [[OpenStack]] Dashboard application. | ||
− | = Build django-nova (OPTIONAL) = | + | == Build django-nova (OPTIONAL) == |
If you want to develop or modify the inner workings of django-nova, complete this step. If not, proceed to the next step. | If you want to develop or modify the inner workings of django-nova, complete this step. If not, proceed to the next step. | ||
Line 82: | Line 82: | ||
These two commands (bootstrap.py and buildout) will install all the dependencies of django-nova. | These two commands (bootstrap.py and buildout) will install all the dependencies of django-nova. | ||
− | = Build and Configure openstack-dashboard = | + | == Build and Configure openstack-dashboard == |
With the reference implementation built, it is now time to configure our Openstack Dashboard application. The first step in configuring the application is to create your local_settings.py file: | With the reference implementation built, it is now time to configure our Openstack Dashboard application. The first step in configuring the application is to create your local_settings.py file: | ||
Line 133: | Line 133: | ||
If everything goes correctly, you shouldn't see any errors. | If everything goes correctly, you shouldn't see any errors. | ||
− | = Run the Server = | + | == Run the Server == |
Now run the built-in server at a high port so that you can view your results | Now run the built-in server at a high port so that you can view your results |
Revision as of 00:42, 27 January 2011
OpenStack Dashboard
The OpenStack Dashboard is a reference implementation for the django-nova project. Both are housed on Launchpad.
To view a quick video tour of the dashboard in action, please see this blog post.
Prerequisites for Running The OpenStack Dashboard
- Running OpenStack nova instance (nova-api and nova-compute) with EC2 API enabled
- URL of your nova-api instance (this is usually something like http://localhost:8773/services/Cloud)
- Valid nova admin user and user credentials (specifically, the username, the NOVA_ACCESS_KEY and NOVA_SECRET_KEY). These should be in your novarc file.
- python 2.6 (not tested with python 3.0)
Installation Overview
The overall steps for building the dashboard are:
- Get the source for both django-nova and openstack-dashboard from launchpad
- (OPTIONAL) Build django-nova with the boostrap script and buildout commands as shown in the dajngo-nova README
- Build and configure openstack-dashboard
- Create the openstack-dashboard database (via the sync-db command)
- Run the server
These instructions are for a test openstack-dashboard deployment. They configure your dashboard to use a sqlite3 database and the default django server. To create a more robust installation, you should configure this with an Apache webserver and MySQL/Postgres database.
Get The Source
To prevent any interruption to our hacking, let's grab all the code that we need.
Create Your Source Directory
$ mkdir src $ cd src
Get django-nova
django-nova is the reference implementation of the openstack dashboard. This module contains almost all of the real code of the website.
$ mkdir django-nova $ cd django-nova $ bzr init-repo . $ bzr branch lp:django-nova/trunk
You should now have a directory called trunk, which contains the reference implementation.
Get openstack-dashboard
openstack-dashboard provides all the look and feel for the dashboard.
$ cd .. $ mkdir openstack-dashboard $ cd openstack-dashboard $ bzr init-repo . $ bzr branch lp:openstack-dashboard trunk
You should now have a directory called trunk, which contains the OpenStack Dashboard application.
Build django-nova (OPTIONAL)
If you want to develop or modify the inner workings of django-nova, complete this step. If not, proceed to the next step.
We will now build the reference implementation that our OpenStack Dashboard will use.
$ cd ../django-nova/trunk $ python bootstrap.py $ bin/buildout
These two commands (bootstrap.py and buildout) will install all the dependencies of django-nova.
Build and Configure openstack-dashboard
With the reference implementation built, it is now time to configure our Openstack Dashboard application. The first step in configuring the application is to create your local_settings.py file:
$ cd ../openstack-dashboard/trunk $ cd local $ cp local_settings.py.example local_settings.py $ vi local_settings.py
In the local_settings.py file, we need to change three important options:
- NOVA_DEFAULT_ENDPOINT : this needs to be set to nova-api instance URL from above. DO NOT KEEP THE DEFAULT as it contains a typo (localhoat instead of localhost). Use 'http://localhost:8773/services/Cloud' if you running the dashboard on the same machine as your nova-api
- NOVA_ACCESS_KEY : this should be the EC2_ACCESS_KEY in your novarc file
- NOVA_SECRET_KEY : this should be the EC2_SECRET_KEY in your novarc file
Now it's time to install the openstack-dashboard environment. This installs all the dependencies for openstack-dashboard (including the django-nova from earlier).
$ sudo easy_install virtualenv $ python tools/install_venv.py ../../django-nova/trunk
This will take a bit as it needs to download a number of dependencies from the internet.
With that done, let's create the database:
$ tools/with_venv.sh dashboard/manage.py syncdb
This will ask you a few questions (follow the instructions within the * * to answer the questions):
You just installed Django's auth system, which means you don't have any superusers defined. Would you like to create one now? (yes/no): *YES* Username (Leave blank to use 'root'): *ENTER YOUR CLOUD_SERVERS_USERNAME FROM NOVARC* E-mail address: *ENTER YOUR EMAIL ADDRESS* Password: *MAKE UP A PASSWORD* Password (again): *REPEAT YOUR PASSWORD*
If everything goes correctly, you shouldn't see any errors.
Run the Server
Now run the built-in server at a high port so that you can view your results
$ tools/with_venv.sh dashboard/manage.py runserver 0.0.0.0:8000
Make sure that your firewall isn't blocking TCP/8000 and just point your browser at this server on port 8000. If you are running the server on the same machine as your browser, this would be "http://localhost:8000".