Setting Up OpenStack on a Raspberry Pi cluster The Easiest Way
By: Pink Academy
Tags: Raspberry Pi, IoT, Servers, Clustering

Since Arm processors are “first-class citizens” in OpenStack, and Raspberry Pis are built on Arm, why not combine them?

In the year since the Raspberry Pi 4 was released, I’ve seen many tutorials (like this and this) and articles on how well the 4GB model works with container platforms such as Kubernetes (K8s), Lightweight Kubernetes (K3s), and Docker Swarm. As I was doing research, I read that Arm processors are “first-class citizens” in OpenStack. Since Raspberry Pi is built on Arm, I decided to test this theory by installing OpenStack on a Raspberry Pi cluster.

Prerequisites

There are a few things I need to consider for this project:

Whether to use Ubuntu 64-bit or CentOS 64-bit for Raspberry Pi to boot headless; Raspberry Pi OS will not suffice, even as a Debian derivative, because there are no OpenStack packages for it. I need the latest version of OpenStack that will run in my distribution because I don’t think the latest versions have an AArch64 image. I doubt that there is any documentation for automating a ground-up installation, so I will use a step-by-step process.

Materials used:

Four Raspberry Pi 4Bs, 4GB model (8GB recommended) Four 32GB MicroSD cards Four Raspberry Pi cases with fans and heatsinks (very important) Four Raspberry Official Power supply

Configure the base operating system

I used the CentOS AArch64 image; as I suspected, there is not a CentOS 8 image available for Raspberry Pi, so I used CentOS 7 AArch64 with this prebuilt image. It didn’t work when I tried installing it with dd , but it worked like a charm when I used balenaEtcher.

After burning the images on the SD cards, I plugged the Raspberry Pis into my router to check their IP addresses so I could remotely access them using SSH. I configured their WiFi and hostnames using nmtui to access them without any cables attached (except for their power source, of course). The default user is root , and the default password is centos .

I updated the operating system:

[root@rpi4b4-0 ~]# yum update -y

I repeated this process on all my Raspberry Pis then rebooted them.

Install OpenStack

The latest OpenStack releases (Ussuri and Victoria) require CentOS 8, so I used Train, as it’s the most recent version that uses CentOS 7.

I used the OpenStack Foundation’s installation steps, but I encountered some issues with it. To make it easier for others to install OpenStack on CentOS 7, I compiled the following links and tips.

Prerequisites

OpenStack services

Imaging service (Glance) Controller node installation Verify operation

TIP: Instead of downloading the CirrOS image mentioned in the documents, make sure to use the AArch64 CirrOS image for Raspberry Pis.

TIP: In the last part of the verify operation, nova-status upgrade check fails due to a packaging error. To fix it, edit the following file in the controller:

[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>

If you run nova-status upgrade check now, it will work.

[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

[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

Dashboarding service (Horizon) Controller node installation

TIP: Upon restarting the httpd service, you will get a 404 error. To resolve it, add this line to the end of the /etc/openstack-dashboard/local_settings :

WEBROOT = '/dashboard'

Then restart httpd as usual:

[root@rpi4b4-X ~]# systemctl restart httpd.service

How well does it work?

This was a fun and successful experiment. In terms of performance, it’s quite slow considering that my controller only has four cores and 4GB RAM, but it’s useful for managing multiple computers in one dashboard. My next step will be to try this with a TripleO deployment and a Ceph storage cluster to enable live migration. I might try using the Raspberry Pi’s Ethernet if I have a larger cluster and workload in mind; for now, Grafana is working fine for internet monitoring.