OpenStack in a Raspberry Pi cluster

OpenStack in a Raspberry Pi cluster
Photo by Hector Bermudez / Unsplash

It’s been a year since Raspberry pi 4 is released,, I’ve seen so many tutorials on how to use Raspberry pi’s with the new 4Gb model and how efficient it is to use in container platforms such as Kubernetes, K3s and, Docker Swarm, but in the advent of researching I saw an articles that talks about Arm-processors being a first class citizen in OpenStack, which is using Raspberry pi thus I tested that theory to install OpenStack in a Raspberry pi cluster.

There are few steps I need to check and do:

  1. Ubuntu 64-bit or Centos 64-bit for Raspberry pi to boot headless, Raspberry pi OS will not suffice even as a Debian derivative there are no openstack packages for it.
  2. Latest version of OpenStack that will run in the chosen distribution, since I don’t think latest versions will have an aarch64 image.
  3. Use ground up installation, with a small community that will do as I did, I doubt that there is any documentation with an automated procedure thus I use the step by step way.

Materials used:

  1. 4x Raspberry Pi 4 B 4GB model (recommended 8GB)
  2. 4x 32GB Micro SD Card
  3. 4x Raspberry Pi case with fan and heatsink (very important)
  4. 4x Raspberry Pi Charger

Configure base Operating System

First I tried to use Ubuntu since it is the nearest to Raspberry pi OS, they have a large community and many users to say that it worked with them, but for me it didn’t work at all, used <code>dd</code> command to install it in the sd card also used balenaetcher to install it but now avail, it doesn’t boot as all for some reason.

Now I tried to download the Centos aarch64 image, as suspected there is no Centos 8 available image for Raspberry pi, thus I used Centos 7 aarch64, this is the link of the image prebuilt image.

I tried to use simple <code>dd</code> at first and it didn’t work for some reason, tried it for the 4 sd cards but it didn’t really work for me, but when I used  it worked like a charm for me.

(image: balenaetcher)

After burning the images in the SD cards, iplug the raspberry pi to my router to check their ip addresses, for me to remotely access the raspberry pi’s using SSH and configured their wifi and hostnames using <code>nmtui</code>to access them without any cable attached to them except their power sources, default user is <code>root</code> and default password is <code>centos</code>.

(image: ssh console of Raspberry pis in Centos 7 aarch64)

Then update the Operating System using <code>yum update -y</code>

<code> [root@rpi4b4-0 ~]# yum update -y </code>

I did this to all my raspberry pi’s and rebooted them afterwards.

OpenStack Installation

As of this writing OpenStack Victoria is already out but when I checked victoria and ussuri needs to have at least Centos 8 as their base OS, thus my nearest latest version is train.

(image: Availability of OpenStack Train)

(image: Unavailability of OpenStack Ussuri and Victoria)

I used what the OpenStack foundation provided steps but for those who follow this blog post they can use this list of links to be a guide on how it should be installed in Centos 7 also I have encountered some issues and added some  tips to prevent that.

Installation guide:

      1. Controller node Installation
      2. Compute node Installation
      3. Verify Operation
      4. All nodes you just need to run the train version of installation
      5. Controller Node Installation
      6. Controller Node Installation
      7. Controller Node Installation
      8. Controller Node Installation
      9. Controller Node Installation
      10. Verify Operation

Identity Service (Keystone)

OpenStack Services

Etcd

Memcached

Message Queue

SQL Database

OpenStack packages

NTP

Prerequisites

(image: Keystone Verification)

    1. Controller Node Installation
    2. Verify Operation

Imaging Service (Glance)

TIP: Instead of Downloading the Cirros Image stated in the document use the aarch64 since we are using Raspberry pi’s this is the link for the aarch64 CIrros image.

(image: Glance Verification)

    1. Controller Node Installation
    2. Verify Operation

Placement Service (Placement)

(image: Placement Verification)

    1. Controller Node Installation
    2. Compute Node Installation
    3. Verify Operation

Compute Service (Nova)

TIP: In the last part of Verify Operation <code>nova-status upgrade check</code> would fail due to a packaging error to fix it edit the following file in the controller:

<code>

[root@rpi4b4-0 ~]# vim /etc/httpd/conf.d/00-placement-api.conf

(…)

<Directory /usr/bin>

   <IfVersion >= 2.4>

      Require all granted

   </IfVersion>

   <IfVersion < 2.4>

      Order allow,deny

      Allow from all

   </IfVersion>

</Directory>

</code>

That would solve the problem if you run <code>nova-status upgrade check</code> this would work already.

(image: Nova Verification)

    1. Controller Node Installation
    2. Controller for Option 2: Self Service Network Installation

Networking Service (Neutron)

To enable the br_netfiler module:

<code>

[root@rpi4b4-0 ~]# modprobe br_netfilter

[root@rpi4b4-0 ~]# echo "br_netfilter" > /etc/modules-load.d/br_netfilter.conf

[root@rpi4b4-0 ~]# lsmod|grep br_netfilter

</code>

  1. Compute Node Installation
  2. Compute for Option 2: Self Service Network Installation

To enable the br_netfiler module:

<code>

[root@rpi4b4-X ~]# modprobe br_netfilter

[root@rpi4b4-X ~]# echo "br_netfilter" > /etc/modules-load.d/br_netfilter.conf

[root@rpi4b4-X ~]# lsmod|grep br_netfilter

</code>

  1. Verify Operation
  2. Verify Operation for Option 2: Self Service Network Installation

(image: Neutron Verification)

    1. Controller Node Installation

Dashboarding Service (Horizon)

TIP:  Upon restarting the httpd service you would get a 404 error to resolve it you need to add this line in the end of the <code> /etc/openstack-dashboard/local_settings </code>

<code> WEBROOT = '/dashboard' </code>

Then restart httpd as usual

<code>[root@rpi4b4-X ~]# systemctl restart httpd.service </code>

  1. Verify Operation

(image: Horizon Verification)

Conclusion

It was a fun experiment and it is a great success, in terms of performance it’s quite slow considering that my controller is only 4 cores and 4GB ram but useful to manage multiple computes in one dashboard, my next step is to try this using TripleO deployment and having a Ceph cluster to enable live migration, maybe i will use the ethernet of raspberry pi if i have a larger cluster and considerable workload in mind, but for now my grafana for internet monitoring is fine.