Installation of Three node OpenStack Queens Cluster – Part Three

Posted on 164 views

Hello guys, this is a continuation from where we left at Installation of Three node OpenStack Queens Cluster – Part Two. Sorry for the delay.

Once glance is up and running, the next step is to add images to it so that we can be able to spin a virtual machine later. To do this, we have to copy the image files to the server. Before that, we have to install a hypervisor that will give us the ability to create virtual machines. KVM is the hypervisor of choice here. Let us hit the road by installing KVM.

“Let the beauty of what you love be what you do. “
–Rumi

[[email protected] ~(keystone)]# yum -y install qemu-kvm libvirt virt-install bridge-utils
 Loaded plugins: fastestmirror
 Determining fastest mirrors
 epel/x86_64/metalink                                                                      |  56 kB  00:00:00     
 base: repos-jnb.psychz.net
 epel: mirror.1000mbps.com
 extras: repos-jnb.psychz.net
 updates: mirror.zol.co.zw
 base                                                                                      | 3.6 kB  00:00:00     
 centos-ceph-luminous                                                                      | 2.9 kB  00:00:00     
 centos-openstack-queens                                                                   | 2.9 kB  00:00:00     
 centos-openstack-queens-debuginfo                                                         | 2.9 kB  00:00:00     
 centos-openstack-queens-source                                                            | 2.9 kB  00:00:00     
 centos-openstack-queens-test

Start and enable libvirtd

[[email protected] ~(keystone)]# systemctl start libvirtd 
[[email protected] ~(keystone)]# systemctl enable libvirtd 

Create CentOS 7 image on Glance Host

[[email protected] ~(keystone)]#  mkdir -p /var/kvm/images
[[email protected] ~(keystone)]# qemu-img create -f qcow2 /var/kvm/images/cent7.img 10G  
 Formatting '/var/kvm/images/cent7.img', fmt=qcow2 size=10737418240 cluster_size=65536 lazy_refcounts=off refcount_bits=16
[[email protected] ~(keystone)]# virt-install \
 --name centos7 \
 --ram 1024 \
 --disk path=/var/kvm/images/cent7.img,format=qcow2 \
 --vcpus 1 \
 --os-type linux \
 --os-variant rhel7 \
 --graphics none \
 --console pty,target_type=serial \
 --location 'http://ftp.iij.ad.jp/pub/linux/centos/7/os/x86_64/' \
 --extra-args 'console=ttyS0,115200n8 serial'

You will see messages like:

Starting install…
 Retrieving file vmlinuz…                                                                | 5.9 MB  00:00:45     
 Retrieving file initrd.img…                                                             |  50 MB  00:04:16     
 Connected to domain centos7
 Escape character is ^]
 [    0.000000] Initializing cgroup subsys cpuset
 [    0.000000] Initializing cgroup subsys cpu
 [    0.000000] Initializing cgroup subsys cpuacct
 [    0.000000] Linux version 3.10.0-862.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018
 [    0.000000] Command line: console=ttyS0,115200n8 serial method=http://ftp.iij.ad.jp/pub/linux/centos/7/os/x86_64/
 [    0.000000] e820: BIOS-provided physical RAM map:
 [    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
 [    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
 [    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
 [    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003ffd8fff] usable
 [    0.000000] BIOS-e820: [mem 0x000000003ffd9000-0x000000003fffffff] reserved
 [    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
 [    0.000000] NX (Execute Disable) protection: active
 [    0.000000] SMBIOS 2.8 present.

After the installation is done, go to /etc/sysconfig/network-scripts/ifcfg-(interface) and comment out HWADDR and UUID fields. On the same file, change BOOTPROTO to dhcp. The file should look like below.

TYPE="Ethernet"
 BOOTPROTO="dhcp"
 DEFROUTE="yes"
 PEERDNS="yes"
 PEERROUTES="yes"
 IPV4_FAILURE_FATAL="no"
 IPV6INIT="yes"
 IPV6_AUTOCONF="yes"
 IPV6_DEFROUTE="yes"
 IPV6_PEERDNS="yes"
 IPV6_PEERROUTES="yes"
 IPV6_FAILURE_FATAL="no"
 IPV6_ADDR_GEN_MODE="stable-privacy"
 NAME="ens160"
 UUID="d9e0aaa7-85c7-49e6-b24e-32101675d623"
 DEVICE="ens160"
 ONBOOT="yes"
 ZONE=public

After that is done, install cloud-init package as shown below:

[[email protected] images(keystone)]# yum -y install cloud-init                      
 Loaded plugins: fastestmirror
 Loading mirror speeds from cached hostfile
 base: mirror.ucu.ac.ug
 centos-qemu-ev: mirror.ucu.ac.ug
 extras: mirror.ucu.ac.ug
 updates: mirror.ucu.ac.ug
 base                                                                                      | 3.6 kB  00:00:00     
 centos-ceph-luminous                                                                      | 2.9 kB  00:00:00     
 centos-openstack-queens                                                                   | 2.9 kB  00:00:00     
 centos-qemu-ev

Enable it:

[[email protected] images(keystone)]# systemctl enable cloud-init

Add any user to the system whom we shall use later for logging purposes

[[email protected] images(keystone)]# useradd tech

[[email protected] images(keystone)]# usermod -aG wheel tech

The virtual machine should be ready by now. At this step, just add it to Glance. In case you get “503 Service Unavailable: The server is currently unavailable. Please try again at a later time. (HTTP 503)”, make sure all the passwords you have been using so far are correct. The ones in the databases whould correspond well with the ones in configuration files. Just verify them slowly and step by step. I got the error and I had to go step by step through all the files and databases to make sure that the passwords were okay.

[[email protected] images(keystone)]# openstack image create "CentOS7" --file /var/kvm/images/cent7.img --disk-format qcow2 --container-format bare --public

+------------------+------------------------------------------------------+
 | Field            | Value                                                |
 +------------------+------------------------------------------------------+
 | checksum         | ea0b87d9dc893502deeb1939323e7fc9                     |
 | container_format | bare                                                 |
 | created_at       | 2019-03-05T16:12:49Z                                 |
 | disk_format      | qcow2                                                |
 | file             | /v2/images/c13fd621-0d74-4e8f-9481-5cbb02decbd3/file |
 | id               | c13fd621-0d74-4e8f-9481-5cbb02decbd3                 |
 | min_disk         | 0                                                    |
 | min_ram          | 0                                                    |
 | name             | CentOS7                                              |
 | owner            | a34bf361461848e2940b332b64fd4249                     |
 | protected        | False                                                |
 | schema           | /v2/schemas/image                                    |
 | size             | 196768                                               |
 | status           | active                                               |
 | tags             |                                                      |
 | updated_at       | 2019-03-05T16:12:50Z                                 |
 | virtual_size     | None                                                 |
 | visibility       | public                                               |
 +------------------+------------------------------------------------------+

Do an image list to confirm its presence:

[[email protected] ~(keystone)]# openstack image list                                             
 +--------------------------------------+---------+--------+
 | ID                                   | Name    | Status |
 +--------------------------------------+---------+--------+
 | c13fd621-0d74-4e8f-9481-5cbb02decbd3 | CentOS7 | active |
 +--------------------------------------+---------+--------+

There we go guys, if you missed out on Part One, please follow the link below:

Installation of Openstack three Node Cluster on CentOS 7 Part One

Cheers guys as we continue to the next sequel.

Installation of Three node OpenStack Queens Cluster – Part Four

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.