Juju add-machine ssh:ubuntu@myraspberrypi3 stuck pending

I just discovered some old raspberry pis in the basement… and thought hmm would juju work on these… luckily it turns out YES… on anything with 64bit chips at least… great… so I spun up Ubuntu 21.x server image… logged into it and setup the ssh daemon to only allow myself in no password logins… great

next I added a raspberry model under my localhost-localhost LXD cloud… so far so good

then I did the

$juju add-machine ssh:ubuntu@192.168.xx.xx

then I waited… and waited… and unfortunately seems it’s still not completed… I looked at the juju debug-log and juju status … nothing seems wrong or obvious so… could it be it’s just the pi is sloooooowly setting things up ?? I mean it IS a PI so…?

thanks !

$ juju debug-log
controller-0: 23:05:34 INFO juju.worker.logforwarder config change - log forwarding not enabled
controller-0: 23:05:34 INFO juju.worker.logger logger worker started
controller-0: 23:05:34 INFO juju.worker.pruner.statushistory status history config: max age: 336h0m0s, max collection size 5120M for raspberry (xxx-xxx-xxx-xxx)
controller-0: 23:05:34 INFO juju.worker.pruner.action status history config: max age: 336h0m0s, max collection size 5120M for raspberry (xxx-xxx-xxx-xxx)
controller-0: 23:05:34 INFO juju.worker.machineundertaker setting up machine undertaker
controller-0: 23:05:34 INFO juju.worker.provisioner entering provisioner task loop; using provisioner pool with 16 workers
controller-0: 23:06:48 INFO juju.worker.logforwarder config change - log forwarding not enabled
controller-0: 23:10:46 INFO juju.worker.logforwarder config change - log forwarding not enabled
controller-0: 23:10:55 INFO juju.worker.logforwarder config change - log forwarding not enabled
controller-0: 23:12:19 INFO juju.worker.provisioner machine 0 already started as instance "manual:192.168.xx.xx"
$ juju status
Model      Controller           Cloud/Region         Version  SLA          Timestamp
raspberry  localhost-localhost  localhost/localhost  2.9.22   unsupported  23:49:46+01:00

Machine  State    DNS             Inst id                Series  AZ  Message
0        pending  192.168.xx.xx   manual:192.168.xx.xx   impish      Manually provisioned machine

Was the mistake to mix this machine with my LXD could and I have to add a manual cloud or ?

EDIT: I think this post confirms my guess… I will give that a try next

I’d guess the issue is likely the juju controller is on your private NAT’d lxd network and the pi can’t route to it.

Can the juju controller in your lxd network reach the pi on ports 22 and 17070, and can that pi call back to 17070 to your juju controller on the lxd network. Many lxd networks have NAT which means the inbound connection back to the lxd controller may not work. But if you provision your lxd cloud controller onto a lxd network which is bridged or routed to your physical or virtual network with the manual machine, they should be able to talk.

You could even add a second bridged LXD network with a port into your already-deployed controller, restart the jujud-machine agent on the controller, and it should be able to advertise the routable IP as another endpoint for controller API to the manual machine.

You could also login to the pi and see what the process tree is stuck on during the provisioning script execution.

1 Like

you likely nailed it with the NAT comment, I hadn’t thought of that … but okay I can experiment with trying out the macvlan in near future… Thank you @afreiberger !

1 Like

@emcp if you get this to work, please let me know! I see a wonderful use-case for our site monitoring. I’d like to place nagios on a rpi and possible some more to have that monitor our hardware etc.

Please, please make this work =)

1 Like

just so I am clear,

are you hoping to mix LXD and Pi machines Erik? if you’ve got the PI on the same vlan I think you’d have no problems… I’ve still not gotten around to using MacVLAN setup to give my LXD containers an IP from a router… and instead using in LXD provided NAT bridge as per usual…

might be useful to verify your LXD containers IPs are getting DHCP from whatever server your PI will use

I have no problems getting my lxc containers IP from my router currently as I set my host up using an existing bridge… It be reported as being a “managed = false” in the lxd config… Works perfectly. That way, my router handles all the DHCP leases, firewalls, portforwarding etc. I love that setup.

1 Like

if you’re using macvlan let me know so I can confirm that thats the path to go… but if you’ve already got the LXD containers and controller on your routers DHCP… adding the pi should be as simple as getting the keys put in place manually and then doing a

juju add-machine ssh:ubuntu@the_ip_address_of_the_pi

1 Like

You are running Ubuntu then?

yeah i didn’t try raspbian… because they favor 32-bit mostly… and Juju doesn’t work generally with 32-bit

I grabbed 20.04 LTS 64-bit

I dunno which Pi you have but… I had a Pi3 and Pi2… and going forward will ONLY have Pi3… just stick to 64-bit OS’s and I think you’re on your way

1 Like