X

How To Install KVM Server on CentOS 7 – Apache Cloud Stack KVM

In this tutorial how to install kvm server on centos 7 for Apache Cloud Stack. Apache Cloud Stack is an open source cloud computing. Its offer many services like public cloud, private cloud, cloud storage, cloud instance & user friendly ui etc.

How To Install Apache Cloud Stack v4.15 On Centos 8

How To Install GitLab Community Edition On Ubuntu 20.04

#####################################
Operating System: CentOS 7.9
IP Address  : 10.66.100.50
RAM   : 8GB
Disk   : 500GB
Service  : Apache Cloud Stack v4.15.1.0
Java   : 11 jdk
Host Name : kvm.technologyrss.local
#####################################

Step #01: Prepare server

cat /etc/redhat-release && ip r

Setup selinux

vi /etc/selinux/config

change to SELINUX=disabled then Save press Esc type :wq then press Enter.

Add all server ip and host name into hosts file. open below file.

vi /etc/hosts

Insert below all lines into this file.

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
10.66.100.15     cloud.technologyrss.local cloud
10.66.100.50     kvm.technologyrss.local kvm
10.66.100.30     acs-nfs.technologyrss.local acs-nfs
Save press Esc type :wq then press Enter.

Also change hostname file.
vi /etc/hostname

Insert below line into this file.

kvm

Step #02: Install dependency packages.

yum install -y wget chrony epel-release
yum -y update
yum -y install bridge-utils net-tools
wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/python36-libvirt-4.5.0-1.el7.x86_64.rpm
yum -y localinstall python36-libvirt-4.5.0-1.el7.x86_64.rpm

Then add Apache Cloud Stack repo.

vi /etc/yum.repos.d/cloudstack.repo

Insert below lines.

[cloudstack]
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/centos/$releasever/4.15/
enabled=1
gpgcheck=0

Save press Esc type :wq then press Enter.

Now run apache cloud stack agent installation command as like below.

yum -y install cloudstack-agent

Step #03: Configure libvirtd.

vi /etc/libvirt/libvirtd.conf

Insert below lines.

listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
auth_tcp = "none"
mdns_adv = 0

Save press Esc type :wq then press Enter.

vi /etc/sysconfig/libvirtd

Remove # from below line.

LIBVIRTD_ARGS="--listen"

Save press Esc type :wq then press Enter.

Now restart libvirtd service using below command.

service libvirtd stop
service libvirtd start
systemctl enable libvirtd

Step #04: Configure kvm Advanced networking.

I have two interface enp2s0 is LAN traffic and enp4s0 for WAN traffic, but enp4s0 is not connected to WAN.

Open LAN interface enp2s0

vi /etc/sysconfig/network-scripts/ifcfg-enp2s0

Remove old text and then insert below all lines into this file. Must be replace as your interface name & mac address.

DEVICE="enp2s0"
HWADDR="8c:89:a5:5a:f5:54"
ONBOOT="yes"
HOTPLUG="no"
BOOTPROTO="none"
TYPE="Ethernet"
BRIDGE="cloudbr0"

Save press Esc type :wq then press Enter.

Open bridge interface cloudbr0

vi /etc/sysconfig/network-scripts/ifcfg-cloudbr0

Insert below all lines into this file. Must be replace as your interface name & own ip address.

DEVICE="cloudbr0"
TYPE="Bridge"
ONBOOT="yes"
BOOTPROTO="none"
IPV6INIT="no"
IPV6_AUTOCONF="no"
DELAY="5"
IPADDR="10.66.100.50"
GATEWAY="10.66.100.10"
NETMASK="255.255.0.0"
DNS1="8.8.8.8"
DNS2="8.8.8.8"
DOMAIN="technologyrss.local"
STP="yes"

Save press Esc type :wq then press Enter.

Open wan interface enp4s0

DEVICE="enp4s0"
HWADDR="00:e0:4a:0b:6a:5a"
ONBOOT="yes"
HOTPLUG="no"
BOOTPROTO="none"
TYPE="Ethernet"
BRIDGE="cloudbr1"

Remove old text and then insert below all lines into this file. Must be replace as your interface name & mac address.

vi /etc/sysconfig/network-scripts/ifcfg-cloudbr1

Insert below all lines into this file. Must be replace as your interface name & own ip address.

DEVICE="cloudbr1"
TYPE="Bridge"
ONBOOT="yes"
BOOTPROTO="none"
IPV6INIT="no"
IPV6_AUTOCONF="no"
DELAY="5"
STP="yes"

Save press Esc type :wq then press Enter.

Step #05: Restart all services using below command.

systemctl stop NetworkManager
systemctl disable NetworkManager
service cloudstack-agent start
systemctl enable cloudstack-agent
mknod /dev/kvm c 10 232
chmod 660 /dev/kvm
chown root:qemu /dev/kvm
service cloudstack-agent status
service libvirtd status
reboot

If you see any error, please see my YouTube video for more details. Please share on your own network for save this guide.

5 1 vote
Article Rating
Admin: I am system administrator as Windows and Linux platform. I have 4 years skilled from the professional period. I have to configure Linux based system such as an Asterisk VOIP system, Network monitoring tools (ZABBIX), Virtualization (XEN Server), Cloud computing (Apache CloudStack) etc. Now share my professional skill each interested person. Thanks to all.
Leave a Comment