I recently reorganised my HomeLab, its something i tend to do every few months as it usually ends up in a mess of half completed or abandoned projects.

One one of the HP MicrosServers I have ESXi 6.7 running however on the other I wanted to get OpenStack working. It's an option at work on the companies platform, however its not something I have had a lot of experience with.

Thankfully OpenStack has DevStack an all in one option to get OpenStack installed on a single box.

The description of Devstack is..

*DevStack is an opinionated script to quickly create an OpenStack development environment. It can also be used to demonstrate starting/running OpenStack services and provide examples of using them from a command line. The example exercises were fleshed out beyond simple examples and became useful as a quick sanity check for the OpenStack installation. That sanity check became the basis for the Gerrit gate tests for all OpenStack checkins and continues in that role until Tempest takes over. These remain as the driving priorities for ongoing DevStack development.

DevStack is not and has never been intended to be a general OpenStack installer. It has evolved to support a large number of configuration options and alternative platforms and support services. However, that evolution has grown well beyond what was originally intended and unfortunately many of the configuration combinations are rarely, if ever, tested.

I've tested the following instructions on Ubuntu 18.04 using the Minimal Install ISO  

The install instructions to get Openstack Devstack are pretty well document at https://docs.openstack.org/devstack/latest/guides/single-machine.html however I did have some issues which needed resolutions which were not documented on the OpenStack site.

After the Ubuntu install is complete, ssh onto the box and the installation process can start

Setup User

We need to add a user for DevStack

sudo useradd -s /bin/bash -d /opt/stack -m stack

The user needs sudo access and will be making many changes to the system, so the user will have the NOPASS option set in the sudo setup

sudo visudo

Add this line to the end of the file

stack ALL=(ALL) NOPASSWD: ALL

Save and exit

Switch to the stack user and go to the home folder of the user

sudo su stack && cd /opt/stack

Download Devstack

Now the user is setup, the installation of the latest Devstack needs to start, the first stage is to download the latest installer from the opendev git server.

sudo apt-get install git -y
git clone https://opendev.org/openstack/devstack
cd devstack

Setup Local Config Options

The install needs a set of locally supplied options to complete, this involves creating a local.conf in the /opt/stack/devstack folder with several options, these are documented as

  • Set FLOATING_RANGE to a range not used on the local network, i.e. 192.168.1.224/27. This configures IP addresses ending in 225-254 to be used as floating IPs.
  • Set FIXED_RANGE to configure the internal address space used by the instances.
  • Set the administrative password. This password is used for the admin and demo accounts set up as OpenStack users.
  • Set the MySQL administrative password. The default here is a random hex string which is inconvenient if you need to look at the database directly for anything.
  • Set the RabbitMQ password.
  • Set the service password. This is used by the OpenStack services (Nova, Glance, etc) to authenticate with Keystone.

Create the local.conf file

nano /opt/stack/devstack/local.conf

Add the following lines, change the passwords and IP range as you see fit

[[local|localrc]]
FLOATINGRANGE=192.168.1.224/27
FIXEDRANGE=10.11.12.0/24
ADMINPASSWORD=supersecret
DATABASEPASSWORD=iheartdatabases
RABBITPASSWORD=flopsymopsy
SERVICEPASSWORD=iheartksl

Save the file and exit

Run the Installer

This is a point I had an issue, run the install command in the /opt/stack/devstack folder

./stack.sh

The installer ran for about 5 minutes and seem to be working then failed with an error about not being able to run virtualenv. To resolve this run

pip install virtualenv
sudo ln -s /opt/stack/.local/bin/virtualenv /usr/local/bin/virtualenv

This will install python virtualenv and ensure that the command is accessible in the path.

Run the install command again

./stack.sh

This will take about 30 minutes

Once complete, the following should be displayed on the screen

DevStack Component Timing
(times are in seconds)

runprocess 41
testwithretry 5
apt-get-update 3
osc 281
waitforservice 29
gittimed 279
dbsync 434
pipinstall 410
apt-get 235

Unaccounted time 1081

Total runtime 2798

This is your host IP address: 192.168..
This is your host IPv6 address: ::1
Horizon is now available at http://192.168../dashboard
Keystone is serving at http://192.168../identity/
The default users are: admin and demo
The password: IChangedMyPassword

WARNING:
Using lib/neutron-legacy is deprecated, and it will be removed in the future

Services are running under systemd unit files.
For more information see:
https://docs.openstack.org/devstack/latest/systemd.html

DevStack Version: ussuri
Change: 01826e1c5b65e8d9c88b4f195bb688137b28c0c5 Merge "Remove fixupvirtualenv" 2020-04-09 16:00:35 +0000
OS Version: Ubuntu 18.04 bionic

2020-04-10 15:48:17.457 | stack.sh completed in 2798 seconds.*

Access OpenShift DevStack

You can now access the OpenStack dashboard on

http://<IP Address>/dashboard

Login with

Username: admin
Password: The Password you set for admin

This should take you to the dashboard

Whats Next?

My next steps are

  • How to add the additional storage the server has available
  • How to create and setup a Virtual Machine
  • Once i've got some confidence in this i'll try and cluster my two HP Microservers

Further Information

https://docs.openstack.org/devstack/latest/guides/single-machine.html

https://docs.openstack.org/devstack/latest/