MAAS Juju Sandbox
Prepare a local environment using KVM virtual machines as the 'bare metal', ready for maas-installation before deployment with Juju.
maas-installation is a related project to install and configure the MAAS server, and add the nodes.
This project assumes to configure these two virsh NAT networks on the host machine:
- 192.168.123.0/24 as the private network
- 192.168.124.0/24 as the public network
Install and Configure Virtual Networks and Machines
On the host machine
scripts/00_install-host.shto prepare the host machine, including creation of virsh networksscripts/01_create-images.shto download the latest cloud image, create VM disks and seed diskscripts/02_define-machines.shto define the VMs in virshscripts/03_generate-secrets.shto generate the secrets and templates files to be used with maas-installation
MAAS Server Configuration
- The
maas0VM is defined inscripts/02_define-machines.sh maas0gets its configuration frommaas0-seed.img, created byscripts/01_create-images.shmaas0/user-datastores the password to be set for theubuntuusermaas0/meta-dataconfigures networking
Initial Environment
Start maas0
virsh start maas0virsh console maas0if you'd like to watch it boot
ssh -o StrictHostKeyChecking=no -l ubuntu 192.168.123.2- Secrets files to be used with maas-installation have been created in
./maas-installation/
Using the mass-installation project code on maas0, install and configure MAAS
- Use the generated secrets as the
maas-installation/secrets/files - During installation,
maas-installation/scripts/install-mass.shalso configures MAAS 'Global Kernel Parameters' to set "console=ttyS0" for virsh console - Add the nodes listed in
maas-installation/secrets/host-inventory.txtto MAASmaas-installation/scripts/maas-add-hosts.sh -d
- Add this maas cloud to Juju
juju add-cloud maas-cloud ${generated_secrets}/maas-clouds.yamljuju add-credential maas-cloud('maas-oath', when prompted, is the API key frommaas-region apikey --username=maas-root)