Hi all. I’ve decided to put together Openstack Lab guide for those who would like to test and learn about Openstack Cloud Computing platform. This is part one of Openstack Lab guide.
In this guide, we’ll go through process of Setting up networking, Configuring hostname, installing any necessary software package needed for smooth running of Openstack. If you’re new to Openstack don’t worry since we’ll go step by step to get Openstack running on your Home Lab.
I recommend you do this on a Laptop, computer or any server with at least 4GB ram, 4 virtual cpu cores and 30 GB free hard disk space. This Lab guide is done on host Machine running CentOS 7.2. You can do this on KVM guest CentOS 7.x server, all you have to do is make sure you’ve KVM nested virtualization enabled.
NOTE: If you’re using CentOS 7 server running on Hypervisor, i recommend you use KVM. If you run on hypervisor like VirtualBox, you’ll default to using QEMU as compute driver and performance won’t be appealing.KVM supports nested virtualization hence you’ll get good performance when launching/running Nova Virtual Machines.
See tutorial below on how to enable nested virtualization for KVM.

Complete Installation of KVM,QEMU and Virt Manager on Arch Linux and Manjaro

Since this is a all in one installation, we’ll run all Openstack services on single node.The services we’ll install and configure throughout this series include:

  1. Openstack OpenStack Identity (keystone) Service
  2. OpenStack Image Service ( Glance) Service
  3. OpenStack Compute Service (Nova)
  4. OpenStack Dashboard (Horizon) Service
  5. OpenStack Network (Neutron) Service
  6. OpenStack Block Storage (Cinder) Service
  7. OpenStack Object Storage (Swift) Service
  8. OpenStack Orchestration Service (Heat) Service
  9. OpenStack Metering Service (Ceilometer) Service

I assume you already have installed CentOS 7.x server. I have a good tutorial on:

Top Things to do after fresh installation of CentOS 7 minimal

  • The first step is to configure hostname:
[root@controller ~]# hostnamectl set-hostname controller

Check hostname:

[root@controller ~]# hostnamectl 
   Static hostname: controller
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 34da37da2c2b404adbed16ea2273bc28
           Boot ID: 913135b537654e80924466455a73f558
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-327.el7.x86_64
      Architecture: x86-64
  • Set timezone
[root@controller ~]# timedatectl list-timezones 
[root@controller ~]# timedatectl set-timezone Africa/Nairobi

Check timezone:

[root@controller ~]# timedatectl 
      Local time: Mon 2016-03-28 15:27:41 EAT
  Universal time: Mon 2016-03-28 12:27:41 UTC
        RTC time: Mon 2016-03-28 12:27:41
       Time zone: Africa/Nairobi (EAT, +0300)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
  • Configure ip address information:

Let’s now configure ip address for our server. First check interface name that you’ll configure:

[root@controller ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:c7:82:36 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.230/24 brd 192.168.122.255 scope global dynamic eth0
       valid_lft 3266sec preferred_lft 3266sec
    inet6 fe80::5054:ff:fec7:8236/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:84:e2:6c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.60/24 brd 192.168.1.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe84:e26c/64 scope link 
       valid_lft forever preferred_lft forever

Then set ip related information:

[root@controller ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1
## My configurations
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
NAME=eth1
UUID=cfb13441-b545-46e6-b7c8-0275872c8f2b
DEVICE=eth1
ONBOOT=yes
IPADDR=192.168.1.60
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
NM_CONTROLLED=no

If you copied configuration and would like to change uuid, generate new uuid using uuidgen tool:

 [root@controller ~]# uuidgen eth1
e956aa35-91b2-4425-95cf-8f088e89c8c6

Change settings according to your requirements, then restart networking:

[root@controller ~]# systemctl disable NetworkManager
[root@controller ~]# systemctl stop NetworkManager 
[root@controller ~]# systemctl restart network.service 

Install Prerequisites:

  1. Add Repos

Epel repo:

[root@controller ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Openstack Liberty repo:
[root@controller ~]# wget https://www.rdoproject.org/repos/rdo-release.rpm
[root@controller ~]# rpm -Uvh rdo-release.rpm
  1. Setup Environment
[root@controller ~]# cat > /etc/environment <<EFO
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
EFO
  1. Install required prerequisite Packages:

Do system update:

[root@controller ~]# yum update -y

Install NTP service:

[root@controller ~]# yum -y install chrony

Install Openssh clients:

[root@controller ~]# yum -y install openssh-clients

Install Rsync:

[root@controller ~]# yum -y install rsync

Install KVM:

[root@controller ~]# yum -y install libvirt qemu-kvm bridge-utils virt-install

MariaDB Database server:

[root@controller ~]# yum -y install mariadb-server
[root@controller ~]# sed -i "/[mysqld]$/a character-set-server = utf8" /etc/my.cnf
[root@controller ~]# sed -i "/[mysqld]$/a collation-server = utf8_general_ci" /etc/my.cnf
[root@controller ~]# sed -i "/[mysqld]$/a init-connect = 'SET NAMES utf8'" /etc/my.cnf

Install RabbitMQ:

[root@controller ~]# yum -y install rabbitmq-server
# Change Rabbitmq password
[root@controller ~]# rabbitmqctl change_password guest new-password

Install Memcached :

[root@controller ~]# yum -y install memcached

Install httpd

[root@controller ~]# yum -y install httpd mod_wsgi

Install MongoDB:

[root@controller ~]# yum -y install mongodb-server mongodb

Start all the services:

[root@controller ~]# systemctl start mariadb.service
[root@controller ~]# systemctl start libvirtd.service
[root@controller ~]# systemctl start chronyd.service
[root@controller ~]# systemctl start rabbitmq-server.service
[root@controller ~]# systemctl start memcached.service
[root@controller ~]# systemctl start httpd.service

Set all services above to start at boot:

[root@controller ~]# systemctl enable mariadb.service
[root@controller ~]# systemctl enable libvirtd.service
[root@controller ~]# systemctl enable chronyd.service
[root@controller ~]# systemctl enable rabbitmq-server.service
[root@controller ~]# systemctl enable memcached.service
[root@controller ~]# systemctl enable httpd.service

Install net-tools package and bash-completion if you don’t have them:

[root@controller ~]# yum -y install net-tools
[root@controller ~]# yum -y install bash-completion 

We’re done with Part 1, in part two, we’ll cover installation of Openstack Packages:
PART TWO:

Openstack Liberty Lab PART TWO: Install Openstack Packages