Hello everyone,
I was recently deploying OpenStack Sunbeam on Ubuntu 24.04 (Noble) and ran into a persistent issue where the deployment would hang and eventually fail during the sunbeam cluster bootstrap step.
The Error:
The bootstrap process would get stuck at “Adding machine to Juju model” and eventually fail with:
⠸ Adding machine to Juju model ... Timeout adding machine 192.168.8.165 to Juju
Error: TIMED OUT to add machine
Troubleshooting & Root Cause:
I verified that networking, UFW, and LXD bridge routing were all functioning correctly. I also verified that passwordless SSH worked for my standard user (openstackadmin) using Juju’s private key (~/.local/share/juju/ssh/juju_id_rsa).
To find the exact failure point, I switched to the openstack-machines model and ran the manual Juju command with debugging:
juju switch openstack-machines
juju add-machine ssh:openstackadmin@192.168.8.165 --debug
The debug logs revealed the issue. Even though I specified openstackadmin@192.168.8.165, the Juju controller (running inside the LXD container) was attempting to SSH into the host machine using the ubuntu user:
18:30:53 INFO juju.environs.manual.sshprovisioner sshprovisioner.go:44 initialising "192.168.8.165", user "openstackadmin"
18:30:53 DEBUG juju.utils.ssh ssh.go:305 using OpenSSH ssh client
(ubuntu@192.168.8.165) Password:
Because my host machine did not have an ubuntu user, SSH fell back to asking for a password. Since the Sunbeam bootstrap runs non-interactively, this password prompt caused the silent timeout.
It appears that under the hood, Juju’s manual provisioning defaults to the ubuntu user regardless of the user specified in the Sunbeam configuration.
The Workaround/Fix:
To resolve this, I had to create an ubuntu user on the host machine, grant it passwordless sudo (which Juju requires to install the agent), and copy the Juju SSH public keys to its authorized_keys file.
# 1. Create the ubuntu user
sudo adduser --disabled-password --gecos "" ubuntu
# 2. Add to required groups
sudo usermod -aG sudo,adm,lxd,snap_daemon ubuntu
# 3. Grant passwordless sudo (Juju requires this)
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/90-ubuntu-sudo-access
# 4. Copy the existing authorized_keys (which contains Juju's key) to the ubuntu user
sudo mkdir -p /home/ubuntu/.ssh
sudo cp ~/.ssh/authorized_keys /home/ubuntu/.ssh/authorized_keys
sudo chown -R ubuntu:ubuntu /home/ubuntu/.ssh
sudo chmod 700 /home/ubuntu/.ssh
sudo chmod 600 /home/ubuntu/.ssh/authorized_keys
After doing this, sunbeam cluster bootstrap immediately progressed past the “Adding machine” step and successfully began deploying the Sunbeam machine.
Has anyone else encountered this? It might be worth looking into whether Sunbeam needs to explicitly force the configured user during the juju add-machine step so it doesn’t default to ubuntu.
Thanks!