Before you begin , you need to prepare the environment before you install
CloudStack. We will go over the steps to prepare now.
Operating System
Install preferred EL8 distro on your hardware. The defaults will generally be acceptable for this
installation - but make sure to configure IP address/parameters so that you can later install needed
packages from the internet. Later, we will change the Network configuration as needed.
Once this installation is complete, you’ll want to gain access to your
server - through SSH.
It is always wise to update the system before starting:
Configuring the Network
Starting with EL8, we must use the Network Manager to configure all network interfaces
(instead of using the network-scripts we have used for so many years).
We will start by creating the bridge that Cloudstack will use for networking.
To avoid remote (ssh) disconnections, you should be logging to the server locally,
via console/physical screen (or save the commands below as a script and then run it
via remote ssh session)
Note
IP Addressing - Throughout this document we are assuming that you will have
a /24 network for your CloudStack implementation. This can be any RFC 1918
Network. However, we are assuming that you will match the machine address
that we are using. Thus we may use 172.16.10.2 and because you might be
using e.g. 192.168.55.0/24 network you would use 192.168.55.2. Another example
would be if you are using i.e. VirtualBox on your local home network on 192.168.1.0/24 network -
in this case you can use a single free IP address from your home range (VirtualBox NIC for this Instance
should be in bridged mode for correct functioning)
#create an "empty” bridge, add eth0 to the bridge, set static IP and reactivate the whole configuration
nmcli connection add type bridge con-name cloudbr0 ifname cloudbr0
nmcli connection modify eth0 master cloudbr0
nmcli connection up eth0
nmcli connection modify cloudbr0 ipv4.addresses '172.16.10.2/24' ipv4.gateway '172.16.10.1' ipv4.dns '8.8.8.8' ipv4.method manual && nmcli connection up cloudbr0
Note
Interface name (eth0) used as example only. Replace eth0 with your default ethernet interface name.
Optionally, we can install the net-tools:
# dnf install net-tools -y
Now that we have the configuration files properly set up, let’s reboot:
Hostname
CloudStack requires that the hostname is properly set. If you used the default
options in the installation, then your hostname is currently set to
localhost.localdomain. To test this we will run:
At this point it will likely return:
To rectify this situation - we’ll set the hostname so that it follows a similar format to this example:
hostnamectl set-hostname server.local --static
After you’ve modified that file, go ahead and reboot:
Now recheck the hostname with the
and ensure that it returns a FQDN response
SELinux
In an ideal environment, selinux should be set to enforcing and the necessary
selinux policies are created to allow the services to run. For this guide,
we will set selinux to permissive mode. This will allow us to install and
configure the services without having to worry about selinux policies.
To configure SELinux to be permissive in the running system we need to run the
following command:
To ensure that it remains in that state we need to configure the file
/etc/selinux/config to reflect the permissive state, as shown in this example:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
NTP (Chrony)
NTP configuration is a necessity for keeping all of the clocks in your cloud
servers in sync. However, NTP is not installed by default. So we’ll install
and and configure NTP at this stage. Installation is accomplished as follows:
The actual default configuration is fine for our purposes, so we merely need
to enable it and set it to start on boot as follows:
# systemctl enable chronyd
# systemctl start chronyd
Configuring the CloudStack Package Repository
We need to configure the machine to use a CloudStack package repository.
Note
The Apache CloudStack official releases are source code. As such there are
no ‘official’ binaries available. The full installation guide describes how
to take the source release and generate RPMs and and yum repository. This
guide attempts to keep things as simple as possible, and thus we are using
one of the community-provided yum repositories. Furthermore, this example
assumes a 4.22.0.0 Cloudstack install - substitute versions as needed.
To add the CloudStack repository, create /etc/yum.repos.d/cloudstack.repo and
insert the following information.
[cloudstack]
name=cloudstack
baseurl=http://download.cloudstack.org/centos/$releasever/4.22/
enabled=1
gpgcheck=0
NFS
Our configuration is going to use NFS for both primary and secondary storage.
We are going to go ahead and setup two NFS shares for those purposes. We’ll
start out by installing nfs-utils.
# dnf -y install nfs-utils
We now need to configure NFS to serve up two different shares. This is handled
in the /etc/exports file. You should ensure that it has the following content:
/export/secondary *(rw,async,no_root_squash,no_subtree_check)
/export/primary *(rw,async,no_root_squash,no_subtree_check)
You will note that we specified two directories that don’t exist (yet) on the
system. We’ll go ahead and create those directories and set permissions
appropriately on them with the following commands:
# mkdir -p /export/primary
# mkdir /export/secondary
NFSv4 requires that domain setting matches on all clients. In our case, the
domain is “local”, so ensure that the domain setting in /etc/idmapd.conf is uncommented and set as follows:
For simplicity, we need to disable the firewall, so that it will not block connections.
Note
Configuration of the firewall is beyond the purview of this guide.
To do so, simply use the following two commands:
# systemctl stop firewalld
# systemctl disable firewalld
We now need to configure the nfs service to start on boot and actually start
it on the host by executing the following commands:
# systemctl enable rpcbind
# systemctl enable nfs-server
# systemctl start rpcbind
# systemctl start nfs-server