Deprecated: Upgrading

Warning

This document is deprecated as of Ganeti Web Manager version 0.11.

Note

Please read the instructions fully before starting. The order of operations is important. The upgrade may fail if done out of order.

This guide will walk you through upgrading Ganeti Web Manager. Our upgrade process uses South, a database migration tool that will update your database.

  1. Backup the database

  2. Download the latest code

  3. Save a copy of settings.py

  4. Deploy code to your existing directory

  5. Copy settings.py back into the directory

Follow the guide for your version.

Upgrading From Version 0.4

If you are upgrading from version 0.4 you will be required to convert your installation to use South. Version 0.4 did not track the database with South, so South must be informed that your installation is already partially migrated. Read the South documentation for more information about converting apps.

  1. Backup your database

  2. install python-django-south.

  3. Add “south” to the list of INSTALLED_APPS inside settings.py

  4. Make sure you add any new settings to settings.py that are listed in Settings Changes

  5. Synchronize the database with ./manage.py syncdb

    $ ./manage.py syncdb
    
    /usr/lib/pymodules/python2.6/registration/models.py:4: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
      import sha
    Syncing...
    Creating table south_migrationhistory
    No fixtures found.
    
    Synced:
     > django.contrib.auth
     > django.contrib.admin
     > django.contrib.contenttypes
     > django.contrib.sessions
     > django.contrib.sites
     > registration
     > logs
     > object_permissions
     > south
    
    Not synced (use migrations):
     - ganeti
     - logs
    (use ./manage.py migrate to migrate these)
    
  6. Convert the ganeti app to use South for future migrations.

    $ ./manage.py migrate ganeti 0001 --fake
    
    /usr/lib/pymodules/python2.6/registration/models.py:4: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
      import sha
     - Soft matched migration 0001 to 0001_version_0_4.
    Running migrations for ganeti:
     - Migrating forwards to 0001_version_0_4.
     > ganeti:0001_version_0_4
       (faked)
    
  7. Convert the logs app to use South for future migrations.

    $ ./manage.py migrate logs 0001 --fake
    
    /usr/lib/pymodules/python2.6/registration/models.py:4: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
      import sha
     - Soft matched migration 0001 to 0001_version_0_4.
    Running migrations for logs:
     - Migrating forwards to 0001_version_0_4.
     > logs:0001_version_0_4
       (faked)
    
  8. Run South migration

    $ ./manage.py migrate
    
    /usr/lib/pymodules/python2.6/registration/models.py:4: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
      import sha
    Running migrations for ganeti:
     - Migrating forwards to 0002_version_0_5.
     > ganeti:0002_version_0_5
     - Loading initial data for ganeti.
    No fixtures found.
    Running migrations for logs:
    - Nothing to migrate.
    

Upgrading from >=0.5

  1. Backup your database

Pre-0.8

  1. Run South migration.

    $ ./manage.py migrate
    

0.8 till 0.11

  1. Delete ghost migrations while running migrations.

    $ ./manage.py migrate --delete-ghost-migrations
    
  2. Update settings.py following the guide below

Settings Changes

The following settings have been added or changed. Please modify settings.py with these new values.

Version 0.5

TESTING

# XXX - Django sets DEBUG to False when running unittests.  They want to ensure
# that you test as if it were a production environment.  Unfortunately we have
# some models and other settings used only for testing.  We use the TESTING flag
# to enable or disable these items.
#
# If you run the unittests without this set to TRUE, you will get many errors!
TESTING = False

ITEMS_PER_PAGE

# default items per page
ITEMS_PER_PAGE = 20

VNC_PROXY

# Enable the VNC proxy.  When enabled this will use the proxy to create local
# ports that are forwarded to the virtual machines.  It allows you to control
# access to the VNC servers.  When disabled, the console tab will connect
# directly to the VNC server running on the virtual machine.
#
# Expected values: False if no proxy, string with proxy host and port otherwise
# String syntax: "HOST:PORT", for example: "localhost:8888"
#
# Note: you will probably have to open more ports in firewall. For proxy's default
# settings, it uses port 8888 for listening for requests and ports 7000..8000
# for serving proxy.
#
# To run proxy (in 'util' directory):
#  $ python vncauthproxy.py --websockets
# If you want to use encryption, then:
#  $ python vncauthproxy.py --websockets --cert=FILE.pem
VNC_PROXY=False

Messages Framework

  • Add django.contrib.messages.middleware.MessageMiddleware to MIDDLEWARE_CLASSES

  • Add django.contrib.messages to INSTALLED_APPS after django.contrib.contenttypes

Version 0.6

Rename Logs App

The logs app has been renamed object_log. Update INSTALLED_APPS to reflect this change.

Version 0.7

South

# Disable South during unittests.  This is optional, but will likely cause unittests
# to fail if these are not set properly.
SOUTH_TESTS_MIGRATE = False
SKIP_SOUTH_TESTS = True

Haystack

# haystack search engine config
HAYSTACK_SITECONF = 'search_sites'
HAYSTACK_SEARCH_ENGINE = 'whoosh'
HAYSTACK_WHOOSH_PATH = os.path.join(DOC_ROOT, 'whoosh_index')

Version 0.8

Remember that it is absolutely critical to back up your database before making any changes.

User Registration

# Whether users should be able to create their own accounts.
# False if accounts can only be created by admins.
ALLOW_OPEN_REGISTRATION = True

More documentation for registration can be found at Open Registration.

Ganeti Version

Ganeti Web Manager version 0.8

Users have experienced problems with Ganeti version 2.1, because it does not support some of the new RAPI features available in version 0.8 of Ganeti Web Manager. (see Issue #8973). To avoid these problems, use GWM 0.8 with Ganeti version 2.4 or better.