Raspberry Pi 4 provisioning and KVM pod setup

Hi there, just wondering if you released the webhook power driver API you created? I also wrote one although it was just a toy with no error checking etc. If yours is in a decent shape it would be useful to others I think.

Hi Anton, do you have any hubs in mind for the article? I’m having trouble finding any with remote control.

Hi, can you see the tutorials category here in discourse? tutorials are written there in markup (take a look at some of the existing ones there), and when ready, we can publish them on maas.io/tutorials.

I should have been more clear. I’m happy for you to use any of my work to write a tutorial, it sounds like you are aiming for a CLI based approach and that does make more sense. I was just asking if you already know of any remote control hubs so I can look into getting one.

(I’m also OK to reformat what I have into markup and put it up here if you feel that is useful)

Ah sorry, yes I misunderstood you. I have been looking at uhubctl which we were thinking we could wrap with a REST API and then use the webhook driver:

There they have a list of supported hubs, I have looked for a few of them on amazon etc but haven’t tried anything. For RPIs, I think the most important thing is to pay attention to the total power output + power output per port (2.4A needed I think?).

If you try something, let me know.

Unfortunately, I have already been to that site and been unable to get hold of any of the listed hubs. But I am in the UK so maybe that is not helping :slight_smile:

hmm I’m in Sweden, same problem. This one might work, haven’t read the manual yet to understand how the power control works:

edit: read up on it, doesnt support per port.

this one might work: https://www.uugear.com/product/mega4-4-port-usb-3-ppps-hub-for-raspberry-pi-4b/

I found something available in europe ‘UUGear MEGA4’.

It does 2.5A per port, total of 5A over 4 ports == 1.25A / port. But I reckon the raspi only needs 6W == 1.2A to run flat out as long as its USB ports are not drawing current (see https://uni.hi.is/helmut/2021/06/07/power-consumption-of-raspberry-pi-4-versus-intel-j4105-system/)

I have ordered one and will let you know how I get on.

1 Like

Ah you found the same one.

1 Like

It’s a race! I’m going to order one too :slight_smile:

Hi Anton,

I have UUGear Mega 4 working nicely with uhubctl and driving 4 Raspis (I’ve not yet tried stress testing them all though).

I also have a nice webhook implementation coming along that will do any command line based control (like uhubctl) and also SmartThings.

I’ll post the code this weekend.

1 Like

Hi Giles that is amazing! I was going to do something similar but life with kids keeps me from that kind of pace ;).

Let’s get a repo going where we can all contribute to make it better - both code for the service and guides. When we think it’s good enough we can make some noise about it, I’m sure a lot of k8s cluster builders will enjoy it.

I think this is ready to share: https://gilesknap.github.io/maaspower

I’m going to add some info on UUGEar Mega4 and the tapo power switch that I have working with this. Maybe bump the test coverage up a bit.


@gilesknap - what can I say? I’m stunned at how quickly you churned that out. I took a look through the docs and the code and I’m really impressed that you made it pluggable which means it should be usable by almost everybody. Love the config idea too, wanted to do that myself :).

With this, and the guide for RPI booting from MAAS, I think it should be relatively simple to throw together a tutorial. I would really like to host it on maas.io/tutorials.

Seems like after many years we have an end-to-end solution for running an RPI cluster together with MAAS!


Hi @gilesknap and @anton5mith , thank you for your work on this. I am really interested by testing your tutorial, I may give you some feedback on it. I am new to MAAS but I would like to try to use MAAS to provision a cluster or RPi 4.

It would be the first step in my homelab project. My plan is to start playing with Juju, Kubernetes and the Charm operators.

The only thing I need now is to find some RPi4 … I hope this global shortage will not continue for too long :sweat_smile:

1 Like

Welcome to the MAAS community!

Giles and I have been working hard on a tutorial - it took a pause while I’m on vacation this week, but I hope it will be out soon (warts and all). I’ll announce it here in the MAAS discourse forum when it’s ready :slight_smile:

in the meantime, maybe you would like to follow this tutorial: https://www.youtube.com/watch?v=sLADei_c9Qg

1 Like

Thank you very much for this link @anton5mith . The tutorial seems great to test the method while I am waiting for my Pis :slight_smile:

1 Like

By the way, I just found this tutorial: https://maas.io/tutorials/build-a-maas-and-lxd-environment-in-30-minutes-with-multipass-on-ubuntu#1-overview .
I think I will start with this so I can learn how to install MASS in a VM with multipass.

@anton5mith I was thinking of adapting the tutorial you sent so I do everything in a multipass VM (https://www.youtube.com/watch?v=sLADei_c9Qg), do you see any problems in doing this?

1 Like

Great, yes the “maas in 30 minutes” tutorial is designed to get you up and running with MAAS as fast as possible.

However, using multipass for the bare metal kubernetes tutorial might give you problems because of nested VMs. The bm k8s tutorial assumes you’re running on a bare metal machine, because it uses LXD VMs to 1) setup some simulated bare metal machines then 2) Juju will try to create more LXD VMs inside those VMs for ceph-mon -> at that point it might fail because you have 3 layers of VMs if you count multipass.

if you do want to make it work, maybe one way is to create more machines for juju. Thinking out loud and untested but perhaps adding more metal machines here:

and here:

and then altering this line so that it doesn’t target LXD on machines 0, 1, and 2:
Perhaps like:
juju deploy -n 3 ceph-mon --to 3,4,5

Or, perhaps you can put ceph-mon directly onto machines 0,1,2 without LXD, haven’t tried it.

In any case, the only thing I think stopping you from running things in multipass is the presence of those 3rd level ceph-mon LXD VMs. If you manage to get something working, let me know.

Hi Everyone

I am trying to get this to work without custom-patching MAAS and using the RPI built-in network bootloader.
So far I’ve managed to get it to pickup an IP address and attempt provisioning by creating this DHCP Snippet with the RPI dhcp/pxe magic numbers: [Source]

option vendor-encapsulated-options 6:1:3:a:4:0:50:58:45:9:14:0:0:11:52:61:73:70:62:65:72:72:79:20:50:69:20:42:6f:6f:74:ff;
option vendor-class-identifier "PXEClient";

This picks up the TFTP server, but now I get “File not found” and “Firmware not found”
I think its looking for “start.elf” and “fixup.dat”

EDIT: Upon further inspection, looks like we need to supply bootcode.bin over tftp and then will try finding start.elf/kernal first in a serial subfolder than the root folder on the tftpboot directory? [Source]