You can use a dashboard interface with an OpenStack Compute installation with a web-based console provided by the Openstack-Dashboard and Django-Nova projects. Together they provide a reference implementation of a Django site that provides web-based interactions with the OpenStack Compute cloud controller. For more information about the Django- Nova project, please visit: http://launchpad.net/django-nova. These instructions are for a test deployment of an OpenStack Dashboard. They configure your dashboard to use a sqlite3 database and the default Django server. To create a more robust, production-ready installation, you would configure this with an Apache web server and MySQL/Postgres database.
6.1. System Requirements
You should have a running OpenStack Compute installation with the EC2 API enabled. The dashboard is installed on the node that is running nova-api and nova-compute. You should know the URL of your nova-api instance.
You must know the credentials of a valid nova admin user, including the username, their EC2 Access Key, and their EC2 Secret Key. These credentials are found in the novarc file created when you created a nova project.
Python 2.6 is required, and these instructions have been tested with Ubuntu 10.10.
6.2. Installation Steps
To build a reference dashboard you must use the two projects together. Here are the overall steps for building the dashboard.
1. Get the source for both django-nova and openstack-dashboard.
2. Optionally, build django-nova with the bootstrap script and build-out commands as shown. 3. Build and configure the openstack-dashboard.
4. Create the openstack-dashboard database with the syncdb command. 5. Run the server that starts the dashboard.
Before you begin, you must have bazaar installed. It's straightforward to install it with sudo apt-get install bzr.
Create a source directory to house both projects:
$ mkdir src
$ cd src
6.2.1. Get the source for both projects
Next, get the source for the django-nova project, which is the reference implementation of the OpenStack Dashboard. This project contains the code for the website.
$ mkdir django-nova $ cd django-nova $ bzr init-repo .
$ bzr branch lp:django-nova/trunk
If you see a message saying "You have not informed bzr of your Launchpad ID..." you can ignore that if you do not want to make changes to the code for now.
You now have a directory named trunk containing the reference implementation.
Next, move up a directory and get the code for the Openstack-Dashboard project, which 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 now have a directory named trunk containing the dashboard application as well as code for the look and feel.
6.2.2. (Optional) Build django-nova
If you want to develop upon or modify the inner workings of django-nova, you'll want to build this reference implementation. If not, proceed to building the OpenStack Dashboard itself. Here is how you build the reference implementation that the dashboard uses:
$ cd ../django-nova/trunk $ python bootstrap.py $ bin/buildout
These two commands (bootstrap.py and buildout) install all the dependencies of django- nova.
Next we will create the virtualenv for local development. A tool is included in the openstack- dashboard project to create one for you. Switch to the /src/openstack-dashboard/trunk directory and then enter:
$ python tools/install_venv.py [path to django-nova/trunk]
If you find that virtualenv is not installed, you can use easy_install virtualenv to
install it and then re-run the python command.
Now that the virtualenv is created, you need to configure your local environment. To do this, create a local_settings.py file in the local/ directory. There is a local_settings.py.example file there that may be used as a template. You configure local_settings.py in the next section.
6.2.3. Build and Configure Openstack-Dashboard
Now you can configure the dashboard application. The first step in configuring the application is to create your local_settings.py file. An example is provided that you can copy to local_settings.py and then modify for your environment.
$ cd ../openstack-dashboard/trunk $ cd local
$ cp local_settings.py.example local_settings.py $ vi local_settings.py
In the new copy of the local_settings.py file, change these 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). You can use 'http://localhost:8773/services/Cloud' if you plan to view the dashboard on the same machine as your nova-api.
• NOVA_ACCESS_KEY : this should be the EC2_ACCESS_KEY in your novarc file (which includes the project name).
• NOVA_SECRET_KEY : this should be the EC2_SECRET_KEY in your novarc file.
Now 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 step takes some time since it downloads a number of dependencies.
Once the download completes, create the database and insert the credentials for your Nova user:
$ tools/with_venv.sh dashboard/manage.py syncdb
Midway through the script, you are asked, "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):" Answer Yes, and insert these values as shown:
Username (Leave blank to use 'root'): *ENTER YOUR NOVA_ADMIN- LEVEL_USERNAME FROM NOVARC*
E-mail address: *ENTER YOUR EMAIL ADDRESS* Password: *MAKE UP A PASSWORD*
Password (again): *REPEAT YOUR PASSWORD*
Once this configuration is complete, you should be returned to the prompt with no errors. If you get 403 errors, it probably means the user is undefined. Check the nova-api log files for specifics.
6.2.4. Run the Server
Now run the built-in server on a high port value so that you can validate the installation.
$ 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".