You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

oVirt is a free to use and open-source virtualization solution sponsored by Red Hat. oVirt is designed to manage your entire enterprise infrastructure. It uses KVM enterprise-grade hypervisor and is built for scalability and high availability. oVirt integration building blocks include other other community projects, including libvirt, Gluster, PatternFly, and Ansible.

In this blog post we’ll be covering the installation and configuration of oVirt Virtualization platform on CentOS 8 servers.

Some key basic features of oVirt are:

  • Rich web-based user interfaces for both admin and non-admin users
  • Integrated management of hosts, storage, and network configuration
  • Live migration of virtual machines and disks between hosts and storage
  • High availability of virtual machines in the event of host failure

Install oVirt on CentOS 8 using Cockpit

We will be performing the self-hosted engine installation of oVirt which uses Ansible and the Engine Appliance (a pre-configured Engine virtual machine image) to automate the following tasks:

  • Configuring the first self-hosted engine node
  • Installation of Enterprise Linux virtual machine on that node
  • Installation and configuration of the oVirt Engine on that virtual machine
  • Configuring the self-hosted engine storage domain

You should have installed CentOS 8 physical server or multiple servers if you plan on having more than one compute node for your Virtualization needs.

If you prefer dedicated oVirt Engine running in a VM refer to our article in the link below.

How To Install Standalone oVirt Engine on CentOS 8

Setup requirements:

The standard setup requirements are:

Step 1: Setup CentOS 8 Server

Login to your CentOS 8 host system with ssh.

$ ssh [email protected]

Confirm it is CentOS 8 System.

$ cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)

Set correct hostname:

sudo hostnamectl set-hostname ovirt-node-01.computingforgeeks.com

Set timezone.

sudo timedatectl set-timezone Africa/Nairobi

Update System.

sudo yum -y update

Wait for the upgrade to complete then reboot the server.

sudo systemctl reboot

Add the official oVirt repository:

sudo dnf -y install https://resources.ovirt.org/pub/yum-repo/ovirt-release44.rpm

Step 2: Prepare storage for oVirt

We recently did a comprehensive guide on setting up oVirt Storage with NFS. Use the link below for a compete steps on how you’ll configure NFS storage for oVirt.

How To Add NFS Data, ISO and Export Storage Domain to oVirt / RHEV

The article covers NFS Data, ISO and Export Storage Domains setup. The only steps necessary for this setup are Step 1 and Step 2.

My Personal Storage Setup ( NFS with Raid 1) – Don’t copy paste!

In my setup I have a number of raw devices which I’ll configure to use RAID 1.

$ lsblk

Installing Raid configuration tool.

sudo dnf -y install mdadm

Clearing disks before Raid configurations.

for i in sdc sdd sde sdf sdg sdh; do
  sudo wipefs -a /dev/$i
  sudo mdadm --zero-superblock /dev/$i
done

Create a partition on the disks and set RAID flag.

for i in sdc sdd sde sdf sdg sdh; do
  sudo parted --script /dev/$i "mklabel gpt"
  sudo parted --script /dev/$i "mkpart primary 0% 100%"
  sudo parted --script /dev/$i "set 1 raid on"
done

Create RAID 1 device:

sudo mdadm --create /dev/md1 --level=raid1 --raid-devices=6 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1

Show Raid device status:

$ cat /proc/mdstat

Create filesystem on the RAID device:

sudo mkfs.xfs /dev/md1

Create mount point:

sudo mkdir /nfs

Configure mounting in /etc/fstab:

echo "/dev/md1 /nfs xfs defaults 0 0" | sudo tee -a /etc/fstab

Confirm it can be mounted correctly:

$ sudo mount -a
$ df -hT

Install NFS server packages:

sudo yum -y install nfs-utils
sudo systemctl enable --now nfs-server rpcbind

Create a system group called kvm on NFS server if it doesn’t exist already:

$ getent group kvm || sudo groupadd kvm -g 36

Create the user vdsm in the group kvm

getent passwd vdsm || sudo useradd vdsm -u 36 -g 36

I’ll create NFS exports directories for oVirt.

sudo mkdir -p /nfs/exports/ovirt/{data,iso,export}

Set the ownership of your exported directories to 36:36, which gives vdsm:kvm ownership:

sudo chown -R 36:36 /nfs/exports/ovirt/data
sudo chown -R 36:36 /nfs/exports/ovirt/iso
sudo chown -R 36:36 /nfs/exports/ovirt/export

Change the mode of the directories to grant owner read and write access:

sudo  chmod 0775 /nfs/exports/ovirt/data
sudo  chmod 0775 /nfs/exports/ovirt/iso
sudo  chmod 0775 /nfs/exports/ovirt/export

Configure NFS exports file like below.

$ sudo vim /etc/exports
/nfs/exports/ovirt/data       *(rw,anonuid=36,anongid=36,all_squash)
/nfs/exports/ovirt/iso        *(rw,anonuid=36,anongid=36,all_squash)
/nfs/exports/ovirt/export     *(rw,anonuid=36,anongid=36,all_squash)

Start and enable NFS server service.

sudo systemctl restart nfs-server
sudo systemctl enable nfs-server

Update NFS exports table.

$ sudo exportfs -rvv
exporting *:/nfs/exports/ovirt/export
exporting *:/nfs/exports/ovirt/iso
exporting *:/nfs/exports/ovirt/data

If you have a running Firewalld service, allow nfs services:

sudo firewall-cmd --add-service={nfs,nfs3,rpc-bind} --permanent
sudo firewall-cmd --reload

Step 3: Install Cockpit with Ovirt plugin and other tools

We need to install Cockpit and the cockpit-ovirt-dashboard plugin from the repository we added.

sudo dnf -y install cockpit cockpit-ovirt-dashboard  gluster-ansible-roles ovirt-engine-appliance

Start and enable Cockpit service after installation.

sudo systemctl enable --now cockpit.socket

Enable cockpit service ports in the firewall.

sudo firewall-cmd --add-service=cockpit
sudo firewall-cmd --add-service=cockpit --permanent
sudo firewall-cmd --reload

Step 4: Install oVirt using the Cockpit wizard

Setup Pre- requisites:

  • FQDNs prepared for your Engine and the deployment host. Forward and reverse lookup records must both be set in the DNS.
# Updating /etc/hosts file
172.21.148.10 ovirt-node-01.computingforgeeks.com  # Deployment host
172.21.148.11 ovirt.computingforgeeks.com          # Ovirt Engine
  • When using a block storage domain, either FCP or iSCSI, a single target LUN is the only supported setup for a self-hosted engine.

Log in to Cockpit as root at https://[Host IP or FQDN]:9090

 Click VirtualizationHosted Engine.

Click on “Hosted Engine” button to deploy oVirt hosted engine on storage that has already been provisioned.

Fill Engine details:

  • VM FQDN – In DNS or added to /etc/hosts
  • IP Address / Gateway / DNS Servers
  • Interface from which a bridge is created
  • Root user password

In the next window set Engine credentials and SMTP for email notifications.

Validate VM details and hit “Prepare VM” button.

Wait for the VM setup to be complete then proceed to configure Storage.

Finish setup then Access Ovirt Engine Dashboard on https://[ServerFQDN]

In the next article we cover how you add hosts to be managed with oVirt Engine.

How To Add Compute Host to oVirt Virtualization

You can support us by downloading this article as PDF from the Link below. Download the guide as PDF