PK ~)Con@ @ # ganeti-webmgr-0.10.2/importing.html
When the Cluster is imported into Ganeti Web Manager it will automatically synchronize. Virtual Machine objects will be created to match what is found on the Ganeti Cluster. Permission Tags will also be parsed to automatically add permissions for virtual machines.
A cluster can be added with only its hostname and port, but a username and password for the cluster are required if you want to make changes to it. Clusters added without a valid username and password appear in Cluster Read Only Mode where you can only change aspects of the cluster that are local to Ganeti Web Manager’s database.
If you’re logged in as a cluster admin or superuser you can edit properties of a cluster by using the “edit” button on the cluster detail page.
Warning
If a cluster is in Cluster Read Only Mode, there will be errors if you try to modify virtual machines or create new ones.
Ganeti Web Manager stores some information about clusters in its database. Cluster and virtual machine information will refresh automatically, but the list of virtual machines must be synchronized manually. This can be done by via the orphans view
Clusters are synchronized when the orphans view is visited.
To add a virtual machine, select “Create VM” in the toolbar. Only fields with multiple options will be selectable. For example, if you are unable to change the cluster to which a VM gets added, it means that there is only one valid option and cluster is a mandatory field.
General Parameters:
Hypervisor parameters:
TODO finish this part
Permission Tags are parsed by virtual machine objects, but sometimes virtual machines will have no tags. To quickly identify virtual machines with no admin users, use the orphans view
Visiting the orphans view will force a synchronization of all clusters and display VirtualMachines that do not have any permissions assigned. You only need to grant permissions directly on virtual machines if you are granting access to non-admin users.
If you haven’t already configured Ganeti Web Manager, now would be a good time to do so.
Now that you have a Ganeti Web Manager instance setup and configured, you will want to deploy it to somewhere that can be accessed by a web browser.
If you are just testing Ganeti Web Manager out, run:
$ python manage.py runserver
Then open a web browser, and navigate to http://localhost:8000.
firefox http://localhost:8000
Follow the django guide to deploy with apache. Here is an example mod_wsgi file:
import os
import sys
path = '/var/lib/django/ganeti_webmgr'
# activate virtualenv
activate_this = '%s/venv/bin/activate_this.py' % path
execfile(activate_this, dict(__file__=activate_this))
# add project to path
if path not in sys.path:
sys.path.append(path)
# configure django environment
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
The virtual environment must be activated for use with mod_wsgi. This is done by executing the activate_this script generated when a virtualenv is created. The following code should be in the django.wsgi file apache is configured to use.
# activate virtual environment
activate_this = '%s/venv/bin/activate_this.py' % PATH_TO_GANETI_WEBMGR
execfile(activate_this, dict(__file__=activate_this))
Please activate JavaScript to enable the search functionality.
From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list.
Ganeti Web Manager caches objects for performance reasons.
Ganeti is a bottleneck when accessing data. In tests, over 97% of time taken to render a normal page in Ganeti Web Manager is spent waiting for Ganeti to respond to queries. Thus, Ganeti Web Manager caches some of Ganeti’s data.
Sometimes it is necessary to refresh objects manually. To do this, navigate to the detail page for the cluster of the object that needs to be refreshed, and click the “Refresh” button. This will refresh the cluster and all of its objects.
Some database-bound objects cache Ganeti data automatically. The functionality for this caching is encapsulated in the CachedClusterObject class. Any models which inherit from this class will gain this functionality.
The cache cannot currently be bypassed reasonably. CachedClusterObject uses __init__() to do part of its work. An unreasonable, albeit working, technique is to abuse the ORM:
values = VirtualMachine.objects.get(id=id)
vm = VirtualMachine()
for k, v in values.items():
setattr(vm, k, v)
RAPI clients are cached in memory, and a hash of cluster information is stored in order to locate them quickly. The entire scheme is no longer necessary since RAPI clients are no longer expensive to allocate, and will be removed soon.
Currently we have use Fabric, a tool for streamlining administration tasks, to deploy Ganeti Web Manager.
Before installing Ganeti Web Manager, make sure you have all the required Dependencies installed.
Download and unpack the latest release, currently this is 0.10.2.
Change to the project directory.
cd ganeti_webmgr
Run Fabric to automatically create a python virtual environment and install required dependencies. This may take a few minutes.
# Deploy a production environment
fab deploy
Changed in version 0.10: fab prod deploy is now fab deploy. fab dev deploy is still the same.
Note
If you would like a more noisy output, adding v, as in fab v deploy, will provide more verbosity.
While in the project root, copy the default settings file settings.py.dist to settings.py:
cp settings.py.dist settings.py
Getting Ganeti Web Manager up and running requires a minimum configuration of a database server. If you don’t have a database server available, and are fine using SQLite, you can skip this step.
Edit settings.py and change the database backend to your preferred database along with filling any any relevant details relating to your database setup.
'default': {
# Add 'postgresql_psycopg2', 'postgresql', 'mysql',
# 'sqlite3' or 'oracle'.
'ENGINE': 'django.db.backends.',
# Or path to database file if using sqlite3.
'NAME': 'ganeti.db',
# Not used with sqlite3.
'USER': '',
# Not used with sqlite3.
'PASSWORD': '',
# Set to empty string for localhost. Not used with sqlite3.
'HOST': '',
# Set to empty string for default. Not used with sqlite3.
'PORT': '',
}
Activate the Python Virtualenv:
source venv/bin/activate
Initialize Database:
MySQL/SQLite:
# Create new tables and migrate all apps using southdb
./manage.py syncdb --migrate
Postgres:
Note
This assumes your doing a fresh install of Ganeti Web Manager on a new Postgres database.
./manage.py syncdb --all
./manage.py migrate --fake
Build the search indexes
./manage.py rebuild_index
Note
Running ./manage.py update_index on a regular basis ensures that the search indexes stay up-to-date when models change in Ganeti Web Manager.
Congradulations! Ganeti Web Manager is now installed and initialized. Next, you’ll want to look into Configuring and Deployment, if you are going to be setting up a production instance. Otherwise, if you just want to play around with Ganeti Web Manager, or are developing, take a look at Testing.