User Tools

Site Tools


open_nebula_kvm_with_drbd

This is an old revision of the document!


Open Nebula KVM cluster with DRBD9

Background

I have two NUCs with an M.2 disk and a SATA disk. I would like to make an Open Nebula cluster out of it keeping the SATA disks in sync using DRBD9 and ZFS. I want the Open Nebula front-end as a VM running on that cluster.

Open Nebula front-end

I created an Ubuntu 18.04 LTS VM using virt-manager on my Linux laptop. Make sure it has a minimum of 2GB memory. Start with an 8GB disk (makes transfer to NUC in the end faster) and expand when deploying on the NUC. Make sure OpenSSH is installed and running.

Initial package stuff and repositories

Open Nebula 5.10 is the latest as of writing. MariaDB 10.4 is the latest as of writing.

apt purge snapd ufw
apt install chrony
systemctl enable chrony
add-apt-repository ppa:linbit/linbit-drbd9-stack
wget -q -O- https://downloads.opennebula.org/repo/repo.key | apt-key add -
echo "deb https://downloads.opennebula.org/repo/5.10/Ubuntu/18.04 stable opennebula" | tee /etc/apt/sources.list.d/opennebula.list
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
echo "deb [arch=arm64,amd64,ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu bionic main" | tee /etc/apt/sources.list.d/mariadb.list
apt update

Install MariaDB and create DB

apt -y install mariadb-server mariadb-client
mysql_secure_installation
mysql -u root -p
CREATE DATABASE opennebula;
GRANT ALL PRIVILEGES ON opennebula.* TO 'oneadmin' IDENTIFIED BY 'secretpassword';
FLUSH PRIVILEGES;

Install Open Nebula front-end packages

apt update
apt -y install opennebula opennebula-sunstone opennebula-gate opennebula-flow

!! DO NOT RUN THE SUGGESTED /usr/share/one/install_gems

Configure Open Nebula

/etc/one/oned.conf
- DB = [ BACKEND = "sqlite" ]
+ #DB = [ BACKEND = "sqlite" ]

+ DB = [ backend = "mysql",
+ server = "localhost",
+ port = 0,
+ user = "oneadmin",
+ passwd = "secretpassword",
+ db_name = "opennebula" ]
su - oneadmin
echo "oneadmin:userpassword" > ~/.one/one_auth

Start Open Nebula

systemctl start opennebula opennebula-sunstone
systemctl enable opennebula opennebula-sunstone

Check if it is working

su - oneadmin -c "oneuser show"
USER 0 INFORMATION
ID              : 0
NAME            : oneadmin
GROUP           : oneadmin
PASSWORD        : *****
AUTH_DRIVER     : core
ENABLED         : Yes

TOKENS

USER TEMPLATE
TOKEN_PASSWORD="******"

VMS USAGE & QUOTAS

VMS USAGE & QUOTAS - RUNNING

DATASTORE USAGE & QUOTAS

NETWORK USAGE & QUOTAS

IMAGE USAGE & QUOTAS

When you see something like above, you can try an login to the web interface: http://<YOUR_IP_HERE>:9869

Install DRBD9 packages

apt update
apt install linstor-controller linstor-client
systemctl enable linstor-controller
systemctl start linstor-controller

For now we leave the controller as is. We need to install the back-ends first.

Open Nebula back-end

Make sure you follow this chapter on every back-end node you want to use. This is going to be a physical installation on the NUCs in my case. Again I am using Ubuntu 18.04 because of the availability of a DRBD9 repository and ZFS! Make sure you do a minimal Ubuntu install with just OpenSSH.

Initial package stuff, repositories and udev

apt purge snapd ufw
apt install chrony
systemctl enable chrony
add-apt-repository ppa:linbit/linbit-drbd9-stack
wget -q -O- https://downloads.opennebula.org/repo/repo.key | apt-key add -
echo "deb https://downloads.opennebula.org/repo/5.10/Ubuntu/18.04 stable opennebula" | tee /etc/apt/sources.list.d/opennebula.list
apt update

I am using a USB-C gigabit ethernet controller and udev creates a network device name with the MAC address of the device. This is not what I want. I just want it to have a generic name. In this case I have chosen eth0.

cp /lib/udev/rules.d/73-usb-net-by-mac.rules /etc/udev/rules.d

Edit the copied file

/etc/udev/rules.d73-usb-net-by-mac.rules
-    IMPORT{builtin}="net_id", NAME="$env{ID_NET_NAME_MAC}"
+    IMPORT{builtin}="net_id", NAME="eth0"

Install software

apt install opennebula-node
apt install qemu-utils virt-manager
apt install zfsutils-linux
systemctl restart libvirtd
systemctl restart libvirt-bin
systemctl enable libvirtd

Configure

/etc/default/zfs
- ZFS_MOUNT='yes'
+ ZFS_MOUNT='no'
- ZFS_UNMOUNT='yes'
+ ZFS_UNMOUNT='no'
open_nebula_kvm_with_drbd.1582461664.txt.gz · Last modified: by herwarth