OpenNebula is a simple but powerful and feature-rich Cloud management solution designed for building and managing enterprise clouds and virtualized DCs. The OpenNebula platform is a combination of existing virtualization technologies with advanced features for elasticity, multi-tenancy, and automatic provision of resources. OpenNebula follows a bottom-up approach driven by sysadmins, devops and users real needs.
Below is a diagram depicting the architectural overview of OpenNebula.
The complete OpenNebula system is comprised of:
- Front-end that executes the OpenNebula services.
- Hypervisor-enabled hosts that provide the resources needed by the VMs.
- Datastores that hold the base images of the VMs.
- Physical networks used to support basic services such as interconnection of the storage servers and OpenNebula control operations, and VLANs for the VMs.
In this guide we look at the installation of OpenNebula Frontend on Debian Linux system.
Here is the minimum recommended specs for the installation of OpenNebula front-end:
Resource | Minimum Recommended configuration |
---|---|
Memory | 8 GB |
CPU | 2 CPU (4 cores) |
Disk Size | 200 GB |
Network | 2 NICs |
The recommendations are meant as a guidance and may be relaxed or increased depending on the size and workload of your cloud.
Step 1: Set hostname, ntp and update system
We begin the installation of OpenNebula Frontend on Debian by updating and upgrading our system
sudo apt update && sudo apt -y full-upgrade
Check if reboot is required
[ -f /var/run/reboot-required ] && sudo reboot -f
Once the system is rebooted set correct hostname replacing nefront.example.com with correct dns name.
sudo hostnamectl set-hostname onefront.example.com
Add IP and hostname to /etc/hosts:
$ sudo vim /etc/hosts
192.168.100.10 onefront.example.com onefront # Set correctly
Install ntp time synchronization tool
sudo apt remove ntp
sudo apt install chrony -y
sudo systemctl start chrony
sudo systemctl enable chrony
Set correct timezone:
sudo timedatectl set-timezone Africa/Nairobi
sudo timedatectl set-ntp yes
Show time status:
$ sudo chronyc sources
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- time.cloudflare.com 3 6 35 13 -49ms[ -49ms] +/- 167ms
^- ntp1.icolo.io 2 6 17 14 +655us[ +655us] +/- 109ms
^* ntp0.icolo.io 2 6 17 16 +251us[ +116ms] +/- 109ms
^+ time.cloudflare.com 3 6 33 13 -49ms[ -49ms] +/- 167ms
Step 2: Add OpenNebula Repositories
We’ll be using the Community edition repositories for this installation.
Import GPG key by running the command below on the terminal:
sudo apt update
sudo apt install wget gnupg2 apt-transport-https -y
curl -fsSL https://downloads.opennebula.io/repo/repo2.key|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/opennebula.gpg
Then add repository file:
### Debian 12 / Debian 11 ###
echo "deb https://downloads.opennebula.io/repo/6.6/Debian/11 stable opennebula" | sudo tee /etc/apt/sources.list.d/opennebula.list
### Debian 10 ###
echo "deb https://downloads.opennebula.io/repo/6.6/Debian/10 stable opennebula" | sudo tee /etc/apt/sources.list.d/opennebula.list
Step 3: Install OpenNebula Frontend on Debian
To install OpenNebula Front-end packages on a Debian Linux system execute these commands in the terminal:
sudo apt update
sudo apt install vim opennebula opennebula-sunstone opennebula-gate opennebula-flow opennebula-provision opennebula-fireedge -y
These are the packages available for these distributions:
- opennebula: OpenNebula Daemon and Scheduler.
- opennebula-common: Shared content for OpenNebula packages.
- opennebula-common-onescape: Helpers for OneScape project.
- opennebula-tools: Command Line Interface.
- opennebula-sunstone: Sunstone (the GUI) and the EC2 API.
- opennebula-gate: OneGate server that enables communication between VMs and OpenNebula.
- opennebula-flow: OneFlow manages services and elasticity.
- opennebula-provision: OneProvision deploys new clusters on remote bare-metal cloud providers.
- opennebula-node: Dependencies and configurations for KVM hypervisor node.
- opennebula-node-firecracker: Dependencies and configurations for Firecracker hypervisor node.
- opennebula-node-lxd: Dependencies and configurations for LXD hypervisor node.
- opennebula-lxd-snap: Meta-package to install LXD snap (only on Ubuntu 16.04 and 18.04).
- opennebula-rubygems: Bundled Ruby gem dependencies.
- opennebula-dbgsym: Package with debug information.
- ruby-opennebula: Ruby Bindings.
- libopennebula-java: Java Bindings.
- libopennebula-java-doc: Java Bindings Documentation.
- python-pyone: Python 2 Bindings (not on Ubuntu 20.04 and later).
- python3-pyone: Python 3 Bindings.
The configuration files are located in /etc/one
and /var/lib/one/remotes/etc
.
sudo ls /etc/one
sudo ls /var/lib/one/remotes/etc/
The following table lists some notable paths that are available in your Frontend after the installation:
Path | Description |
---|---|
/etc/one/ |
Configuration Files |
/var/log/one/ |
Log files, notably: oned.log , sched.log , sunstone.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 |
Step 4: Install MariaDB database server
We’ll use MariaDB database server to persist OpenNebula cloud data. Install it on Debian system by running the command below/
sudo apt update
sudo apt -y install mariadb-server
Secure your database server installation:
sudo mysql_secure_installation
Connect to the MariaDB console as root
sudo mysql -u root -p
Create a new user and grant it privileges on the opennebula database. The database doesn’t need to exist as OpenNebula will create it the first time it runs.
GRANT ALL PRIVILEGES ON opennebula.* TO 'oneadmin' IDENTIFIED BY 'St0ngDBP@ssw0rd';
FLUSH PRIVILEGES;
Also configure the transaction isolation level:
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
EXIT
Step 5: Configure OpenNebula Front-end Database
Before running OpenNebula for the first time, set the database connection details in oned.configuration.
$ sudo vim /etc/one/oned.conf
#Uncomment and edit lines around 76
DB = [ BACKEND = "mysql",
SERVER = "localhost",
PORT = 3306,
USER = "oneadmin",
PASSWD = "St0ngDBP@ssw0rd",
DB_NAME = "opennebula",
CONNECTIONS = 25,
COMPARE_BINARY = "no" ]
The fields to be configured are:
- 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.
Switch your active account to oneadmin:
sudo su - oneadmin
A randomly generated password is stored in the file /var/lib/one/.one/one_auth:
$ cat /var/lib/one/.one/one_auth
oneadmin:KnejitanRoc1
Above file contains the following <username>:<password>. In my case the password for oneadmin user is SkonmoipOtt1
You can change the password before starting OpenNebula. For example:
echo "oneadmin:MyStr0ngPassw0rd" > ~/.one/one_auth
cat /var/lib/one/.one/one_auth
exit
Note: This sets the oneadmin password on the first boot. From that point, the oneuser passwd
is used to change oneadmin’s password.
Finally start OpenNebula after effecting the changes:
sudo systemctl restart opennebula
sudo systemctl restart opennebula-sunstone
Enable the services to start at system boot:
sudo systemctl enable opennebula
sudo systemctl enable opennebula-sunstone opennebula-fireedge.service
Confirm the running status of the services:
$ systemctl status opennebula
● opennebula.service - OpenNebula Cloud Controller Daemon
Loaded: loaded (/lib/systemd/system/opennebula.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-03-18 12:39:07 EAT; 52s ago
Main PID: 3160 (oned)
Tasks: 93 (limit: 4667)
Memory: 245.0M
CGroup: /system.slice/opennebula.service
├─3160 /usr/bin/oned -f
├─3164 ruby /usr/lib/one/mads/one_hm.rb -p 2101 -l 2102 -b 127.0.0.1
├─3205 ruby /usr/lib/one/mads/one_vmm_exec.rb -t 15 -r 0 kvm
├─3222 ruby /usr/lib/one/mads/one_vmm_exec.rb -t 15 -r 0 lxd
├─3240 ruby /usr/lib/one/mads/one_vmm_exec.rb -t 15 -r 0 firecracker
├─3257 ruby /usr/lib/one/mads/one_vmm_exec.rb -l deploy,shutdown,reboot,cancel,save,restore,migrate,poll,pre,post,clean,update_sg,snapshotcreate,snapsh
├─3274 ruby /usr/lib/one/mads/one_tm.rb -t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,ceph,dev,vcenter,iscsi_libvirt
├─3295 ruby /usr/lib/one/mads/one_datastore.rb -t 15 -d dummy,fs,lvm,ceph,dev,iscsi_libvirt,vcenter -s shared,ssh,ceph,fs_lvm,qcow2,vcenter
├─3311 ruby /usr/lib/one/mads/one_market.rb -t 15 -m http,s3,one,linuxcontainers,turnkeylinux,dockerhub
├─3327 ruby /usr/lib/one/mads/one_ipam.rb -t 1 -i dummy
├─3341 ruby /usr/lib/one/mads/one_auth_mad.rb --authn ssh,x509,ldap,server_cipher,server_x509
├─3355 /usr/lib/one/mads/onemonitord -c monitord.conf
├─3372 ruby /usr/lib/one/mads/one_im_exec.rb -r 3 -t 15 -w 90 firecracker
├─3387 ruby /usr/lib/one/mads/one_im_exec.rb -r 3 -t 15 -w 90 kvm
├─3401 ruby /usr/lib/one/mads/one_im_exec.rb -r 3 -t 15 -w 90 lxd
├─3415 ruby /usr/lib/one/mads/one_im_exec.rb -l -c -t 15 -r 0 vcenter
└─3424 ruby /var/lib/one/remotes/im/lib/vcenter_monitor.rb
$ systemctl status opennebula-sunstone
● opennebula-sunstone.service - OpenNebula Web UI Server
Loaded: loaded (/lib/systemd/system/opennebula-sunstone.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-03-18 12:39:44 EAT; 47s ago
Main PID: 3635 (ruby)
Tasks: 2 (limit: 4667)
Memory: 100.4M
CGroup: /system.slice/opennebula-sunstone.service
└─3635 /usr/bin/ruby /usr/lib/one/sunstone/sunstone-server.rb
...
Step 6: Verify OpenNebula Frontend installation
Switch back to the user.
sudo su - oneadmin
Check that the commands can connect to the OpenNebula daemon:
$ oneuser show
USER 0 INFORMATION
ID : 0
NAME : oneadmin
GROUP : oneadmin
PASSWORD : c69c19205e9b73874e6da7e563b8f6021b2ad46d5e1d3ffe8a9c2649eceda02d
AUTH_DRIVER : core
ENABLED : Yes
TOKENS
USER TEMPLATE
TOKEN_PASSWORD="53ab1aa03cd733601db2d96e0d6f0e1296da69cc7a52e9fcd0236b9831e5cd94"
VMS USAGE & QUOTAS
VMS USAGE & QUOTAS - RUNNING
DATASTORE USAGE & QUOTAS
NETWORK USAGE & QUOTAS
IMAGE USAGE & QUOTAS
An error message in the output means OpenNebula daemon could not be started properly.
The Log files are located in:
$ ls /var/log/one
monitor.log oned.log oned.log-20230318-1616060092.gz onehem.log sunstone.log
novnc.log oned.log-20230318-1616060087.gz oned.log-20230318-1616060331 sched.log vcenter_monitor.log
Check oned.log
for any error messages, marked with [E]
.
Step 7: Login to Sunstone web interface
With the services started and confirmed to be working you can try login to Sunstone web interface on the URL:
http://<frontend_address>:9869
You should see login page loaded:
Login details are:
Username: oneadmin
Password: cat /var/lib/one/.one/one_auth
You can view username and password with:
$ cat /var/lib/one/.one/one_auth
If the page does not load, make sure you check /var/log/one/sunstone.log and /var/log/one/sunstone.error.
Step 8: Install OpenNebula KVM Node
In the next guide we cover addition of OpenNebula KVM Node to the Frontend to start Virtual Machines Management.
Step 9: Configure Bridge for VMs Networking
Check our guide below on Network configuration.
Step 10: Configure OpenNebula Datastores
Datastores are used to store OS images and Virtual Machines data.
Step 11: Add OS Images
Here is a link to helpful guide: