OpenStack-Dashboard written by python-django works

OpenStack-Dashboard

Code base has been moved to GitHub
https://github.com/4p/openstack-dashboard



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.
Installation Steps

1.To build a reference dashboard you must use the two projects together. Here are the overall steps for building the dashboard.
2.Get the source for both django-nova and openstack-dashboard.
3.Optionally, build django-nova with the bootstrap script and build-out commands as shown.
4.Build and configure the openstack-dashboard.
5.Create the openstack-dashboard database with the syncdb command.
6.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

Get the source for both projects
Next, get the source for the django-nova project. 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 and is a reference implementation of the django-nova project.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.
(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.

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 #不一定在trunk目錄層,目前版本要再進去一層
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. 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.

If you are using an admin user that is named something other than "admin", add the following two options to the local_settings.py file. In this example, the admin user is named "osadmin".

NOVA_ADMIN_USER = 'osadmin'

NOVA_PROJECT = 'osadmin'
One additional option is available in the local_settings.py file, the default region. This can be set to anything, but is set to nova by default.

NOVA_DEFAULT_REGION = 'nova'

Now install the openstack-dashboard environment. This installs all the dependencies for openstack-dashboard (including the django-nova from earlier). If you don't already have

easy_install installed, use sudo apt-get install python-setuptools.
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 file (typically /var/log/nova/nova-api.log) for specifics.

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 #DMZ 區請NAT 80port 到此位址

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".





Comments

Popular posts from this blog