For this setup, we’ll use the maas-server as the juju client to interact with the cluster.
This guide was very useful:
https://maas.ubuntu.com/docs/juju-quick-start.html
Update to the latest stable tools:
sudo apt-add-repository ppa:juju/stableNext we want to setup juju on the host machine.
sudo apt-get update
sudo apt-get install juju-coreCreate juju environment file.
juju initGenerate a specific MAAS API key by using the following link:
http://192.168.100.10/MAAS/account/prefs/
write the following to ~/.juju/environments.yaml replacing ‘maas api key’ with what was generated above:
default: vmaasNow let’s sync tools and bootstrap a node. Note, if you have multiple juju environments then you may need to specify ‘-e vmaas’ if it isn’t your default environment.
environments:
vmaas:
type: maas
maas-server: 'http://192.168.100.10/MAAS'
maas-oauth: '<maas api key>'
admin-secret: ubuntu # or something generated with uuid
default-series: trusty
juju sync-toolsSee if it works by using the following command:
juju bootstrap # add --show-log --debug for more output
juju statusYou should see something similar to the following:
~$ juju statusNow we can do a test deployment with the juju-gui to our bootstrap node.
environment: vmaas
machines:
"0":
agent-state: down
agent-state-info: (started)
agent-version: 1.18.4
dns-name: maas-node-0.maas
instance-id: /MAAS/api/1.0/nodes/node-e41b0c34-e1cb-11e3-98c6-5254001aae69/
series: trusty
services: {}
juju deploy juju-guiWhile it is deploying you can type the following to get a log.
juju debug-logI wanted to be able to access the juju-gui from an ‘external’ address, so I edited /etc/networking/interfaces on that machine to have a static address:
juju ssh 0
sudo vim /etc/networking/interfacesAdd the following to the file:
auto eth0Bring that interface up.
iface eth0 inet static
address 192.168.100.11
netmask 255.255.255.0
sudo ifup eth0The password can be found here on the host machine:
grep pass .juju/environments/vmaas.jenvIf you used the above configurations it should be ‘ubuntu’.
Log into the service so you can monitor the status graphically during the deployment.
If you get errors saying that servers couldn’t be reached you may have DNS configuration or proxy issues. You’ll have to first resolve these before using Juju. I’ve had is intermittent network issues in my lab. In order to workaround those physical issues you may have to retry the bootstrap, or increase the timeout values in ~/.juju/environments.yaml to use the following:
bootstrap-retry-delay: 5Now you’re cooking with juju.
bootstrap-timeout: 1200