OpenNebula Zones Server Setup 3.0

This guide intends to give a walk through the steps needed to correctly configure the oZones Server to start managing Zones and VDCs. Also, it provides steps to configure a reverse proxy based on the Apache web server to hide the VDC details from end users.

inlinetoc

Requirements

  • Ruby Gems
    • Rubygems needs to be installed
    • gem install json thin rack sinatra libopenssl-ruby
    • gem install data_mapper
    • For sqlite DBs: gem install dm-sqlite-adapter
    • For postgres DBs: gem install dm-postgres-adapter
    • For mysql DBs: gem install dm-mysql-adapter
  • Apache
    • Version should be >=2.2
    • apt-get install libopenssl-ruby apache2
  • Zones
    • There should be at least one Zone properly configured and running, which is basically a site running and managed by an OpenNebula instance, no further configuration is needed to turn it into a Zone.

Configuration

Configure Apache

Apache needs to be configured to act as a reverse proxy, using the mod_proxy module. To correctly configure it, the following steps need to be taken:

:!: The following details are valid for Ubuntu installations, but it should be fairly easy to extrapolate to any other linux flavor.

  • Enable these modules:

<xterm> $ sudo a2enmod rewrite $ sudo a2enmod proxy_http </xterm>

  • Edit /etc/apache2/apache2.conf and add the following at the end
ServerName <hostname-of-ozones-front-end>
  • Edit /etc/apache2/mods-available/proxy.conf and change “Deny from all” line to “Allow from all”
  • Then edit /etc/apache2/sites-available/default. Change the following
<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None

To this:

<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
  • Restart apache

<xterm> $ sudo /etc/init.d/apache2 restart </xterm>

Configure oZones Server

Before starting the oZones server be sure to:

  • Edit /etc/one/ozones-server.conf and change any of the following parameters accordingly:
Attribute Description
databsetype This can be set to 'sqlite', 'postgres' or 'mysql'.
htaccess Location of the root .htaccess file for the apache reverse proxying configuration, if not sure leave the default /var/www/.htaccess. This file needs to be writable by “oneadmin” (or the user executing the ozones-server), one option is to precreate the .htaccess file and change its owner to oneadmin.
dbdebug Wether the DB related events are going to be logged or not.
host Hostname of the server running the oZones server.
port Port of the server where the oZones server will listen.
  • Set OZONES_AUTH the first time the oZones server is started, it will add to the DB the credentials of the zones administrator (which is the user entitled to add new zones and created VDCs). This credentials will be retrieved from the file pointed out by the environment variable $OZONES_AUTH, which should contain the credentials separated by a colon, like 'username:password'. The same credentials will be needed to be used to access the oZones server using the CLI or the GUI.

It is recommended to run the ozones server under an unprivileged user (like “oneadmin”). Start simply the server that will be listening in the target URL with: <xterm>

ozones-server start

ozones-server listening on 127.0.0.1:6121 </xterm>

Configure oZones Client

You will need to set the following environment variables in order to use the CLI:

Variables Description
OZONES_URL Should point to the HTTP URL of the oZones server (defaults to “http://localhost:6121”).
OZONES_AUTH Should point to a file containing the oZones administrator credentials separated by a colon, like 'username:password'.