How to set up and utilize OpenNebula to build a powerful open source cloud.
OpenNebula is an Open Source Cloud Management Platform that allows you to build Private Clouds with ease.
OpenNebula is an alternative to OpenStack and covers the majority of functionality available by OpenStack. OpenNebula is a mature platform and describes itself as "Enterprise Ready" with a wide user-base and proven stability/scale-ability.
This guide shows how to deploy and install OpenNebula in a one-node configuration. Additional hosts can easily be prepared and added in a future stage by following the "Installing OpenNebula KVM Node" section in the bottom of this article.
While OpenNebula is very lightweight and can be used on a t1.small ($.07/hr) device with no issues, we will use a c1.small server ($.40/hr) with Ubuntu 16.04 in this guide. The single machine will host OpenNebula’s Management Interface as well as the KVM Hypervisor to run Virtual Machines in the same node.
When deploying your server you should select a /29 IPv4 subnet (4 Usable IP’s), which will be used to assign VM’s. This saves you the trouble of requesting additional IP’s post-deployment using Packet's Elastic IPv4 feature.
Selecting a subnet size
Let’s go ahead and deploy this node:
It should take about 10 minutes for your server to deploy and install. Once the server is provisioned you can SSH into the device by using authorized SSH keys.
First, add OpenNebula to the apt-get repository -
# wget -q -O- https://downloads.opennebula.org/repo/repo.key | apt-key add - OK # apt-get install apt-transport-https
# echo "deb https://downloads.opennebula.org/repo/5.6/Ubuntu/16.04 stable opennebula" > /etc/apt/sources.list.d/opennebula.list
Then install OpenNebula and dependencies (OpenNebula Management Interface)
# apt-get update # apt-get install -y opennebula opennebula-sunstone opennebula-gate opennebula-flow
# /usr/share/one/install_gems PRESS [ENTER] To continue
Utilize MySQL Database instead of SQLite (optional but recommended for production workloads).
# apt-get install -y mysql-server While not mandatory, it is highly recommended that you set a password for the MySQL administrative "root" user.
After MySQL is installed you need to add privileges to oneadmin.
# 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) mysql> SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; mysql> exit
The final step in enabling MySQL includes modifying the oned.conf (ONE Daemon Configuration) file.
# nano /etc/one/oned.conf Navigate down to DB Section, and comment out DB = [ backend = “sqlite” ] Uncomment the MySQL Section and enter the password you set via GRANT ALL PRIVILEGES.
# systemctl start opennebula # systemctl start opennebula-sunstone
Test if OpenNebula is running properly:
# oneuser show USER 0 INFORMATION ID : 0 NAME : oneadmin GROUP : oneadmin PASSWORD : 3bc15c8aae3e4124dd409035f32ea2fd6835efc9 AUTH_DRIVER : core ENABLED : Yes The above text means that OpenNebula is operating normally, and no additional changes need to be made.
Log into OpenNebula Sunstone Interface
This will output your OpenNebula Username:Password which can be used to Manage your deployment.
# cat /var/lib/one/.one/one_auth oneadmin:Vu29Sk39zMn9
Now navigate to http://147.75.x.x:9869 to find the user interface.
Install OpenNebula KVM Node
You can repeat these steps in additional nodes to add additional nodes to your cluster.
# sudo apt-get install -y opennebula-node Country of origin for the keyboard: 29 (US = 29) # sudo service libvirt-bin restart
# sudo su oneadmin $ cd ~/.ssh We need to ensure that the front-end can login to each node without any input, when adding additional nodes you need to sync the front-end .ssh folder with each node. $ cp id_rsa.pub authorized_keys This step should log you into the same user account using SSH without any input other than adding the host to your known_hosts file. $ ssh <hostname> Are you sure you want to continue connecting (yes/no)? Yes Welcome to Ubuntu 16.04.3 LTS $ exit Connection to <hostname> closed. $ exit Now we are back to our root account.
Create a Network Bridge
You can follow this guide to create a network bridge for KVM on Bonded Networks with Packet.net.
Adding KVM Node to Sunstone
Navigate to Infrastructure -> Hosts -> +
Type in your hostname:
Press refresh after a few seconds pass.
Adding a Network Subnet
Navigate to Network -> Virtual Networks -> +
Type your bridge name in Conf Tab.
Add your /29 subnet to Addresses Range:
Setup the context with the correct variables:
Adding Virtual Machine Images
Navigate to Storage -> Apps -> Search “KVM”
These are the images found in the default OpenNebula Marketplace.
Let’s select Ubuntu 16.04 and add it to our Image Datastore.
Select the default Datastore and click Download:
You can navigate to Storage -> Images to see the new entry. It will be in status: LOCKED for the first minute until the server completes the download and then it will become status: READY.
Let’s configure the template that came with the image, in order to add our own keys - or modify the default config.
Templates -> VMs -> Ubuntu 16.04 KVM -> Update
We can now deploy a VM using this template,
Navigate to Instances -> VMs -> +
Voila, our VM is now running after a minute or two of initialization.
We can access the VM Console by using VNC.
Time to build your own cloud with OpenNebula!
- OpenNebula 5.4 Docs
- OpenNebula Installation
- OpenNebula Node Installation
- OpenNebula Storage Configuration
- OpenNebula Network Configuration
To enhance your OpenNebula deployment, you can check for partner integrations via the OpenNebula Technology Partner Ecosystem.
For example, you can use an open source platform called VirtEngine to automate application deployments in OpenNebula, as well as offer OpenNebula Virtual Machines to customers via a UI that integrates with billing.