Difference between revisions of "OpenStackDashboard"
Line 4: | Line 4: | ||
The OpenStack Dashboard is a reference implementation for the django-nova project. Both are housed on Launchpad. | The OpenStack Dashboard is a reference implementation for the django-nova project. Both are housed on Launchpad. | ||
− | + | = Prerequisites for Running The [[OpenStack]] Dashboard = | |
− | The overall steps for building | + | * 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 user and user credentials for nova (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 | # Get the source for both django-nova and openstack-dashboard from launchpad | ||
# Build django-nova with the boostrap script and buildout commands as shown in the dajngo-nova README | # 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) | # Create the openstack-dashboard database (via the sync-db command) | ||
# Run the server | # Run the server | ||
− | The | + | = Get The Source = |
+ | To prevent any interruption to our hacking, let's grab all the code that we need. | ||
− | + | == Create Your Source Directory == | |
− | |||
− | |||
− | + | <pre><nowiki> | |
− | + | $ mkdir src | |
− | + | $ cd src | |
+ | </nowiki></pre> | ||
− | |||
− | + | == 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. | ||
− | + | <pre><nowiki> | |
− | ---- | + | $ mkdir django-nova |
+ | $ cd django-nova | ||
+ | $ bzr init-repo . | ||
+ | $ bzr branch lp:django-nova/trunk | ||
+ | </nowiki></pre> | ||
− | |||
− | + | 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. | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | $ cd .. | ||
+ | $ mkdir openstack-dashboard | ||
+ | $ cd openstack-dashboard | ||
+ | $ bzr init-repo . | ||
+ | $ bzr branch lp:openstack-dashboard trunk | ||
+ | </nowiki></pre> | ||
− | |||
− | |||
− | + | You should now have a directory called trunk, which contains the [[OpenStack]] Dashboard application. | |
+ | = Build django-nova = | ||
+ | We will now build the reference implementation that our [[OpenStack]] dashboard will use. | ||
− | |||
− | |||
− | |||
− | |||
− | + | <pre><nowiki> | |
+ | $ cd ../django-nova/trunk | ||
+ | $ python bootstrap.py | ||
+ | $ bin/buildout | ||
+ | </nowiki></pre> | ||
− | |||
− | + | 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: | ||
− | |||
− | + | <pre><nowiki> | |
+ | $ cd ../openstack-dashboard/trunk | ||
+ | $ cd local | ||
+ | $ cp local_settings.py.example local_settings.py | ||
+ | $ vi local_settings.py | ||
+ | </nowiki></pre> | ||
− | + | 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). | |
− | |||
− | + | <pre><nowiki> | |
− | + | $ sudo easy_install virtualenv | |
− | + | $ python tools/install_venv.py ../../django-nova/trunk | |
− | + | </nowiki></pre> | |
− | |||
− | |||
+ | 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: | ||
− | |||
− | |||
− | + | <pre><nowiki> | |
− | + | $ tools/with_venv.sh dashboard/manage.py syncdb | |
+ | </nowiki></pre> | ||
− | |||
− | |||
− | This will | + | This will ask you a few questions: |
− | |||
− | + | <pre><nowiki> | |
− | + | 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* | ||
+ | </nowiki></pre> | ||
− | + | 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 | ||
+ | <pre><nowiki> | ||
+ | $ tools/with_venv.sh dashboard/manage.py runserver 0.0.0.0:8000 | ||
</nowiki></pre> | </nowiki></pre> | ||
+ | |||
+ | |||
+ | Make sure that your firewall isn't blocking TCP/8000 and just point your browser at your server on port 8000. |
Revision as of 23:55, 26 January 2011
OpenStack Dashboard
The OpenStack Dashboard is a reference implementation for the django-nova project. Both are housed on Launchpad.
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 user and user credentials for nova (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
- 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
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
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:
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 your server on port 8000.