We will learn How to Install Self Hosted oVirt Engine using command line on Rocky Linux 8. The official guide for oVirt could be the detailed one but we have come up with the specific steps required to successfully bring up oVirt out of the different pages mentioned in the Official steps.
The new release for oVirt which is 4.5.5 is released after a year since December 2022 so there are few changes to the official repo and the suggested one is to use the latest nightly repo to overcome any known issues. Please do follow each of such steps to ensure successful bring up of oVirt manager on Rocky Linux 8.
Pre-requisite
In this blog we are considering to have the Ovirt manager to be running on the same host which will be used as host (compute node). We will also assume that this is setup is behind some corporate network hence we will show how to use proxy to reach out the Ovirt Repo
- Rocky Linux 8 Host Installed as “Infrastructure Server” OR “Virtualization Host”. You can refer our previous blog post How to Install Rocky Linux 8
- IP and Unique DNS names for Ovirt Host . Example ovirthost.linuxquery.org
- IP and Unique DNS names for Ovirt Manager VM. Example ovirtmgr.linuxquery.org
- The DNS names resolution is a must for a Self hosted Engine deployment.
- The Backend Shared storage. One of the following – NFS, iSCSI, FCP, Gluster. For more details refer Preparing for Ovirt Storages
- Proxy server – I have used http://192.168.255.126:8080 in this tutorial. You can replace with yours.
Preparing the Host Server with proper Repo
Login to the Ovirt host ovirthost.linuxquery.org using the SSH.
Since we are behind a corporate network we will use proxy for the yum/dnf to reach out to the Ovirt Repo
echo "proxy=http://192.168.255.126:8080" >> /etc/yum.conf
In order to install oVirt 4.5 on RHEL 8 or derivatives you’ll need to provide CentOS Stream required configuration. The following commands will make such configuration
dnf install -y dnf-plugins-core
dnf config-manager --set-disabled extras
cat >/etc/yum.repos.d/CentOS-Stream-Extras.repo <<'EOF'
[cs8-extras]
name=CentOS Stream $releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/8-stream/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
EOF
cat >/etc/yum.repos.d/CentOS-Stream-Extras-common.repo <<'EOF'
[cs8-extras-common]
name=CentOS Stream $releasever - Extras common packages
mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=extras-extras-common
#baseurl=http://mirror.centos.org/$contentdir/8-stream/extras/$basearch/extras-common/
gpgcheck=1
enabled=1
gpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-Extras
EOF
echo "8-stream" > /etc/yum/vars/stream
dnf distro-sync --nobest
Reset the Virt Module
# dnf module reset virt
Enable the virt
module in the Advanced Virtualization stream with the following command:
# dnf module enable virt:rhel
Configuring the Firewall
Running Firewall before we run the self-hosted deployment script is a must. We also need to have an active zone with an interface configured.
# systemctl unmask firewalld
# systemctl start firewalld
To ensure firewalld starts automatically at system start, enter the following command as root:
# systemctl enable firewalld
Check the status now
# systemctl status firewalld
Installing Required Packages
Start with installing the CentOS based Ovirt Repo. Although we will use the nightly repo provided by ovirt but keeping this repo won’t create any conflict
dnf install -y centos-release-ovirt45
As discussed in oVirt Users mailing list we suggest the user community to use oVirt master snapshot repositories ensuring that the latest fixes for the platform regressions will be promptly available.
export http_proxy=http://192.168.255.126:8080
export https_proxy=http://192.168.255.126:8080
dnf copr enable -y ovirt/ovirt-master-snapshot centos-stream-8
Unset the proxy now
unset http_proxy
unset https_proxy
Install other required packages
dnf install -y ovirt-release-master
dnf install -y ovirt-openvswitch
dnf install -y cockpit-ovirt-dashboard cockpit-machines
dnf install ovirt-engine-appliance
dnf install ovirt-hosted-engine-setup
dnf install tmux
Script Deployment
Use the tmux
window manager to run the script to avoid losing the session in case of network or terminal disruption.
tmux
Since we are behind the corporate network so the packages which will be downloaded and installed in the Ovirt Engine VM will not be able to connect to the outside world hence we need to make sure to get this script halted at the stage where the Engine packages would start getting installed. At this stage we will configure the proxy in the VM and then we can accordingly proceed.
Alternatively, to pause the deployment after adding the host to the Engine, use the command line option
hosted-engine --deploy --ansible-extra-vars=he_pause_before_engine_setup=true --4
To escape the script at any time, use the Ctrl+D keyboard combination to abort deployment. In the event of session timeout or connection disruption, run tmux attach to recover the deployment session.
The script will prompt you for a series of question on deployment types, Network config, user credentials followed by the storage that you choose. In some cases you may use the default values by simply hitting “Enter”. Since this is quite long I am not putting it here but would request to follow the Offcial page for referring the different parameter that need to be provided.
Please refer the section 5.3. Deploying the self-hosted engine using the command line in the Link below which talks in details about all the questions being asked.
CLI deployment of Ovirt Engine
Once you have provided with all the above questions and if the scripts successfully moves forward at one point it will get halted for you to provide the configuration to the newly spinned VM manager on the host.
You can Open Another SSH session for the Host leaving the present session as it is and then using the FQDN ovirtmgr.linuxquery.org you can SSH to the newly created VM. You can login using root and the password would be the same that you have entered during the script deployment stage.
ssh root@ovirtmgr.linuxquery.org
Once logged into the Engine VM edit the file /etc/yum.conf to add the proxy
echo "proxy=http://192.168.255.126:8080" >> /etc/yum.conf
Logout of the VM and now on the host ovirthost.linuxquery.org go to /tmp folder where you will find a lock file. You need to simply delete that file and once done the paused script will move further.
The script when successfully executed you should be able to see the Ovirt Manager Web URLs which can be used to access the Administration portal
Accessing the Administration portal
You can now access the Administration Portal using a web browser.
In a web browser, navigate to https://manager-fqdn/ovirt-engine, replacing manager-fqdn with the FQDN that was provided during installation which would look like http://ovirtmgr.linuxquery.org
Click Administration Portal. An SSO login page displays. SSO login enables you to log in to the Administration and VM Portal at the same time.
Enter your User Name and Password. If you are logging in for the first time, use the user name admin@ovirt along with the password that you specified during installation. Then Click Log In.
Conclusion
There are several helpful resources that aid with the deployment and operation of the oVirt Virtualization platform in addition to this blog post. You can visit and examine the official oVirt Documentation in particular. Go through the different parts to find some helpful information. What differently we have tried to bring here is the collection of all necessary steps out of the all the sections of the Official pages to make sure you get to the end result successfully without even investing time to go through all the steps which may not be necessary.