OpenNebula

OpenNebula is the industry standard for on-premise IaaS cloud computing, offering the most feature-rich, flexible solution for the comprehensive management of virtualized data centers to enable private, public and hybrid (cloudbursting) clouds. OpenNebula interoperability makes cloud an evolution by leveraging existing IT infrastructure, protecting your investments, and avoiding vendor lock-in.

Installation

Install the opennebula package from the repository.

pacman -S opennebula  

These are the packages available for this distribution:

  • opennebula: Command Line Interface.
  • opennebula-server: Main OpenNebula daemon, scheduler, etc.
  • opennebula-sunstoneSunstone (the GUI) and the EC2 API.
  • opennebula-ruby: Ruby Bindings.
  • opennebula-java: Java Bindings.
  • opennebula-gateOneGate server that enables communication between VMs and OpenNebula.
  • opennebula-flowOneFlow manages services and elasticity.
  • opennebula-node-kvm: Meta-package that installs the oneadmin user, libvirt and kvm.
  • opennebula-common: Common files for OpenNebula packages.

OpenNebula Contextualisation

pacman -S one-context

Configuration

OpenNebula supports multiple hypervisors (QEMU-KVM, Xen, VMware) which means that the configuration of your OpenNebula deployment is dependent on which hypervisor technology you plan on using, but because OpenNebula uses libvirt for managing virtual machines (VMs) some of the OpenNebula configuration is hypervisor agnostic. The hypervisor agnostic configuration will be in this section and the hypervisor dependent configuration will be in the appropriate sub-sections.

Ruby Runtime Installation

Some OpenNebula components need Ruby libraries. OpenNebula provides a script that installs the required gems as well as some development libraries packages needed.

As root execute:

/usr/share/one/install_gems --showallgems | xargs -l gem install --no-user-install --no-document --conservative

The previous script is prepared to detect common Linux distributions and install the required libraries. If it fails to find the packages needed in your system, manually install these packages:

  • sqlite3 development library
  • mysql client development library
  • curl development library
  • libxml2 and libxslt development libraries
  • ruby development library
  • gcc and g++
  • make

 

Enabling MySQL/MariaDB (Optional)

You can skip this step if you just want to deploy OpenNebula as quickly as possible. However if you are deploying this for production or in a more serious environment, make sure you read the MySQL Setup section.

Note that it is possible to switch from SQLite to MySQL, but since it’s more cumbersome to migrate databases, we suggest that if in doubt, use MySQL from the start.

Configuring MySQL

You need to add a new user and grant it privileges on the opennebula database. This new database doesn’t need to exist, OpenNebula will create it the first time you run it.

Assuming you are going to use the default values, log in to your MySQL server and issue the following commands:

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. [...]

mysql> GRANT ALL PRIVILEGES ON opennebula.* TO 'oneadmin' IDENTIFIED BY '<thepassword>';
Query OK, 0 rows affected (0.00 sec)

Now configure the transaction isolation level:

mysql> SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;

Configuring OpenNebula

Before you run OpenNebula for the first time, you need to set in oned.conf the connection details, and the database you have granted privileges on.

# Sample configuration for MySQL
DB = [ backend = "mysql",
       server  = "localhost",
       port    = 0,
       user    = "oneadmin",
       passwd  = "<thepassword>",
       db_name = "opennebula" ]

Fields:

  • server: URL of the machine running the MySQL server.
  • port: port for the connection to the server. If set to 0, the default port is used.
  • user: MySQL user-name.
  • passwd: MySQL password.
  • db_name: Name of the MySQL database OpenNebula will use.

Using OpenNebula with MySQL

After this installation and configuration process you can use OpenNebula as usual.

Starting OpenNebula

Warning: If you are performing an upgrade skip this and the next steps and go back to the upgrade document.

Log in as the oneadmin user follow these steps:

The /var/lib/one/.one/one_auth fill will have been created with a randomly-generated password. It should contain the following: oneadmin:<password>. Feel free to change the password before starting OpenNebula. For example:

echo "oneadmin:mypassword" > ~/.one/one_auth

Warning: This will set the oneadmin password on the first boot. From that point, you must use the oneuser passwd command to change oneadmin’s password.

You are ready to start the OpenNebula daemons. You can use systemctl for Linux distributions which have adopted systemd:

systemctl start opennebula
systemctl enable opennebula-econe
systemctl enable opennebula-oneflow
systemctl enable opennebula-onegate
systemctl enable opennebula-scheduler
systemctl enable opennebula-sunstone

Linux CLI

In the Front-end, run the following command as oneadmin:

oneuser show
USER 0 INFORMATION
ID              : 0
NAME            : oneadmin
GROUP           : oneadmin
PASSWORD        : 3bc15c8aae3e4124dd409035f32ea2fd6835efc9
AUTH_DRIVER     : core
ENABLED         : Yes

USER TEMPLATE
TOKEN_PASSWORD="ec21d27e2fe4f9ed08a396cbd47b08b8e0a4ca3c"

RESOURCE USAGE & QUOTAS

If you get an error message, then the OpenNebula daemon could not be started properly:

oneuser show
Failed to open TCP connection to localhost:2633 (Connection refused - connect(2) for "localhost" port 2633)

The OpenNebula logs are located in /var/log/one, you should have at least the files oned.log and sched.log, the core and scheduler logs. Check oned.log for any error messages, marked with [E].

Sunstone

Now you can try to log in into Sunstone web interface. To do this point your browser to http://<fontend_address>:9869. If everything is OK you will be greeted with a login page. The user is oneadmin and the password is the one in the file /var/lib/one/.one/one_auth in your Front-end.

If the page does not load, make sure you check /var/log/one/sunstone.log and /var/log/one/sunstone.error. Also, make sure TCP port 9869 is allowed through the firewall.

Directory Structure

The following table lists some notable paths that are available in your Front-end after the installation:

Path Description
/etc/one/ Configuration Files
/var/log/one/ Log files, notably: oned.logsched.logsunstone.log and <vmid>.log
/var/lib/one/ oneadmin home directory
/var/lib/one/datastores/<dsid>/ Storage for the datastores
/var/lib/one/vms/<vmid>/ Action files for VMs (deployment file, transfer manager scripts, etc…)
/var/lib/one/.one/one_auth oneadmin credentials
/var/lib/one/remotes/ Probes and scripts that will be synced to the Hosts
/var/lib/one/remotes/hooks/ Hook scripts
/var/lib/one/remotes/vmm/ Virtual Machine Manager Driver scripts
/var/lib/one/remotes/auth/ Authentication Driver scripts
/var/lib/one/remotes/im/ Information Manager (monitoring) Driver scripts
/var/lib/one/remotes/market/ MarketPlace Driver scripts
/var/lib/one/remotes/datastore/ Datastore Driver scripts
/var/lib/one/remotes/vnm/ Networking Driver scripts
/var/lib/one/remotes/tm/ Transfer Manager Driver scripts

If you need more info on other parameters for opennebula you can consult their wiki

Calogero Scarnà
Calogero Scarnà
Articoli: 299

Newsletter

Inserisci il tuo nome e il tuo indirizzo email qui sotto e iscriviti alla nostra newsletter