Adam Hoke

I am a programmer and web developer. Currently working on cloud-base web applications.

Setting Up Openstack Mitaka on CentOS

29 May 2017 » cloud, blog


Openstack setup on CentOS, using RDO project repositories. Not a simple task.


Openstack

Mitaka is the 13th release of the Openstack cloud computing framework. It’s the most widely deployed version of Openstack and the most stable version available. It has enhanced manageability from previous versions and can be deployed onto your own servers for creating a cloud. More info can be found here


RDO Project

The RDO project is a group of developers who maintain Openstack on CentOS, Fedora, and RHEL. They maintain the repo that will be used in this post. The project’s homepage can be found here


Setting up Openstack on CentOS

The first step is to install the RDO repository:

$ sudo yum install -y centos-release-openstack-mitaka


Then once that is installed, install openstack ‘packstack’:

$ sudo yum install -y openstack-packstack


The openstack-packstack module contains packstack in addition to openstack. Packstack is a utility that uses puppet and puppet modules to deploy Openstack.

Trying to run a basic openstack setup using the ‘allinone’ option:

packstack --allinone


Didn’t work correctly on the first run. It seems the yum cache gets frequently corrupted and there are some prerequisites that need to be installed before packstack can download and install the packages it needs. Here’s a few I installed before continuing:

sudo yum install -y puppet hiera openssh-clients tar nc rubygem-json erlang


This helped but didn’t get things working. Here’s the error message I received:

ERROR : Error appeared during Puppet run: 10.0.2.15_prescript.pp
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install openstack-selinux' returned 1: Error downloading packages:
You will find full trace in log /var/tmp/packstack/20170311-235531-d93RwD/manifests/10.0.2.15_prescript.pp.log


So I installed openstack-selinux. I also had to repeat this process with similar errors for mariadb-server-galera, python-openstackclient, and openstack-cinder. This let me get further, but now I had a new error:

Could not prefetch cinder_type provider 'openstack'


This took some research on the internet, and I found a solution that worked for me. Finding the last answerfile generated by the packstack installer, I edited that answerfile to remove ‘lvm’ value from the ‘CONFIG_CINDER_BACKEND’ field, leaving it blank. Then I moved that file to where I was running packstack from and renamed it ‘answers.txt’. Now, run packstack specifying that answerfile to use:

packstack --answer-file=answers.txt


Continuing on with the process, I encountered additional errors with dependencies not being found. I’m not sure why the script didn’t try to download and install these dependencies automatically, but nonetheless they were easy to resolve using yum:

sudo yum install -y openstack-nova-common

sudo yum install -y openstack-ceilometer-compute

sudo yum install -y memcached

sudo yum install -y openstack-dashboard

sudo yum install -y openstack-swift-account

sudo yum install -y python-gnocchiclient

sudo yum install -y redis

sudo yum install -y python-redis

sudo yum install -y openstack-aodh-evaluator


(Note: these could be all installed in one chained command but I wanted to illustrate the order in which I encountered unmet dependency problems with the script.)

After installing these unmet dependencies, I progressed further with the packstack installer until I encountered a different error. This time it was with Nagios and some of its plugins:

Notice: /Stage[main]/Main/Exec[nagios-plugins-ping]/returns: Error: Nothing to do
Error: yum install -y -d 0 -e 0 monitoring-plugins-ping returned 1 instead of one of [0]
Error: /Stage[main]/Main/Exec[nagios-plugins-ping]/returns: change from notrun to 0 failed: yum install -y -d 0 -e 0 monitoring-plugins-ping returned 1 instead of one of [0]
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install nagios-plugins-nrpe' returned 1: No Presto metadata available for centos-openstack-mitaka


Experimentally installing these packages did the trick:

yum install -y nagios nagios-plugins-ping monitoring-plugins-ping


With this error resolved, there was only more missing dependency issue I encountered, ‘nrpe’:

sudo yum install -y nrpe


After this, the final message I received when the install was successful was:

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

Additional information:
 * 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 10.0.2.15. 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 10.0.2.15. To use the command line tools you need to source the file.
 * Copy of keystonerc_admin file has been created for non-root user in /home/stack.
 * To access the OpenStack Dashboard browse to http://10.0.2.15/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
 * To use Nagios, browse to http://10.0.2.15/nagios username: nagiosadmin, password: 3a24a25c2c6b4344
 * The installation log file is available at: /var/tmp/packstack/20170312-222849-b5Mr9t/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20170312-222849-b5Mr9t/manifests


Summary

Admittedly, his was not something I figured out overnight. Openstack Mitaka is on CentOS is not as stable or mature as it is on Ubuntu (I have not tried to install on Ubuntu, but based on seeing everyone having the same issues and having difficulties online with the CentOS version, it’s apparent this is the case.) Here are the key takeways that helped me finally get this working:

  • Use the yum repository centos-release-openstack-mitaka NOT git-hub or the RDO project links online.
  • install packstack installer, then run with –allinone option.
  • There’s no mention of this in the docs, but you need these yum packages installed on your system: puppet hiera openssh-clients tar nc rubygem-json erlang
  • When ever the script throws an error with yum (for whatever reason) manually install that package using yum, then retry the script.
  • When the packstack eventually crashes and complains about cinder, make note of the answerfile location. Edit that file to remove lvm from CONFIG_CINDER_BACKEND, and restart packstack using the –answerfile flag.
  • Keep manually installing dependencies that are missing and causing installer failures, this will eventually work.