OpenStack all-in-one setup on CentOS

OpenStack is an open-source cloud operating system for setting up IAAS (infrastructure as a service). OpenStack provides a flexible solution for both public and private clouds, covering the two important requirements i.e. cloud must be simple to implement and massively scalable. For production a minimal OpenStack setup requires at-least 2 separate machine, one controller and one compute node. To get started with OpenStack, a common practice is to setup an all-in-one deployment i.e. using a single machine.
This guide is about setting-up an all-in-one setup for OpenStack Queens, the latest release.


Step 0 – Pre-requisites (preparing the machine)

Let’s look what is the system architecture

[nahmed@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

and the version of the CentOS

[nahmed@localhost ~]$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
OpenStack doesn’t recommend using firewalld, networkManager – as it uses Iptables, which conflicts with firewalld. NetworkManager does things dynamically to the network adapters, that OpenStack may not aware of, hence may cause serious network issues. So, recommended/best practice is to you use basic network utility.

Stop and disable NetworkManager

sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager

Stop and disable firewalld

sudo systemctl stop firewalld
sudo systemctl disable firewalld

Restart network service

$ sudo systemctl restart network

Disable SELinux

Can do it permanently in file /etc/selinux/config change SELINUX=enforcing to SELINUX=disabled.
setenforce 0
or,
$ sudo vi /etc/selinux/config

Update (OPTIONAL – but very useful)

As it’ll make you skip the python-cryptography conflict bug, in the future updates.
$ sudo yum -y update

Configure a static IP address

By default CentOS uses DHCP to get an IP for the machine, the problem with it is on reboot the IP may change – in case of OpenStack we need to keep the IP static, otherwise it’ll break the installation. Here’s a simple step-by-step guide for setting static IP on CentOS.

Resolve hostname (optional)

Set your hostname in /etc/hosts
[nahmed@localhost ~]$ hostname
localhost.localdomain
[nahmed@localhost ~]$ hostnamectl
Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: 1d82e790c32944cbb0e2489b3c387360
Boot ID: e2349ce439574ac1b95bcb981894b1e7
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-327.28.3.el7.x86_64
Architecture: x86-64
[nahmed@localhost ~]$  cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
If you are using non-English locale make sure your /etc/environment is populated:
[nahmed@localhost ~]$ sudo vi /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Restart the machine.


Step 1 – Install OpenStack RPM

On CentOS, the Extras repository provides the RPM that enables the OpenStack repository. Extras is enabled by default on CentOS 7, so you can simply install the RPM to set up the OpenStack repository. The current latest release is Queens – in case you want to install some older version, here is the list of available RDO repos.
$ sudo yum-config-manager --enable openstack-queens
Output
RDO Queens

Update

$ sudo yum -y  update

It’s a good practice to reboot system, here

$ sync;reboot

Step 2 – Install Packstack

Packstack is an OpenStack setup utility, it uses Puppet modules to deploy, using SSH.
$ sudo yum install -y openstack-packstack

Step 3 – Deploy and run OpenStack using Packstack

$ sudo packstack --allinone
Output
Welcome to the Packstack setup utilityThe installation log file is available at: /var/tmp/packstack/20180502-004510-oUvzLC/openstack-setup.log
Packstack changed given value  to required value /root/.ssh/id_rsa.pubInstalling:
Clean Up                                             [ DONE ]
Discovering ip protocol version                      [ DONE ]
Setting up ssh keys                                  [ DONE ]
Preparing servers                                    [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Preparing pre-install entries                        [ DONE ]
Setting up CACERT                                    [ DONE ]
Preparing AMQP entries                               [ DONE ]
Preparing MariaDB entries                            [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries                           [ DONE ]
Preparing Glance entries                             [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries                             [ DONE ]
Preparing Nova API entries                           [ DONE ]
Creating ssh keys for Nova migration                 [ DONE ]
Gathering ssh host keys for Nova migration           [ DONE ]
Preparing Nova Compute entries                       [ DONE ]
Preparing Nova Scheduler entries                     [ DONE ]
Preparing Nova VNC Proxy entries                     [ DONE ]
Preparing OpenStack Network-related Nova entries     [ DONE ]
Preparing Nova Common entries                        [ DONE ]
Preparing Neutron LBaaS Agent entries                [ DONE ]
Preparing Neutron API entries                        [ DONE ]
Preparing Neutron L3 entries                         [ DONE ]
Preparing Neutron L2 Agent entries                   [ DONE ]
Preparing Neutron DHCP Agent entries                 [ DONE ]
Preparing Neutron Metering Agent entries             [ DONE ]
Checking if NetworkManager is enabled and running    [ DONE ]
Preparing OpenStack Client entries                   [ DONE ]
Preparing Horizon entries                            [ DONE ]
Preparing Swift builder entries                      [ DONE ]
Preparing Swift proxy entries                        [ DONE ]
Preparing Swift storage entries                      [ DONE ]
Preparing Gnocchi entries                            [ DONE ]
Preparing Redis entries                              [ DONE ]
Preparing Ceilometer entries                         [ DONE ]
Preparing Aodh entries                               [ DONE ]
Preparing Puppet manifests                           [ DONE ]
Copying Puppet modules and manifests                 [ DONE ]
Applying 192.168.169.130_controller.pp
192.168.169.130_controller.pp:                       [ DONE ]
Applying 192.168.169.130_network.pp
192.168.169.130_network.pp:                          [ DONE ]
Applying 192.168.169.130_compute.pp
192.168.169.130_compute.pp:                          [ DONE ]
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]

**** Installation completed successfully ******

Additional information:
* A new answerfile was created in: /root/packstack-answers-20180502-004512.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
* Warning: NetworkManager is active on 192.168.169.130. OpenStack networking currently does not work on systems that have the Network Manager service enabled.
* File /root/keystonerc_admin has been created on OpenStack client host 192.168.169.130. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.169.130/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
* The installation log file is available at: /var/tmp/packstack/20180502-004510-oUvzLC/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20180502-004510-oUvzLC/manifests
(no need for this, if you have executed the above command) If you don’t want to run packstack –allinone, rightaway as it installs everything (more then you may need). You can specify what to configure using answers file. First generate the answers file
$ packstack --gen-answer-file=answer.txt

Step 4 – Verify

Let’s verify by logging into the dashboard (called as Horizon). The path for the dashboard gets printed at the end of stdout of the above command (packstack –allinone).

The dashboard

horizon
The default username will be admin, and you can get the password (if you haven’t set it in the answers.txt file) from the keystonerc_admin, can find it at the /root directory (Keystone is the identity service/component for the OpenStack)
keystone rc

Sign-In

openstack sign-in

Leave a Reply

Your email address will not be published. Required fields are marked *