Interested in MAAS and Juju? Here’s how to try it in a VM

Canonical

on 15 November 2013

Tags: Tutorial

This article was last updated 9 years ago.


The backbone for scale-out workload deployments in Ubuntu, such as big data (Hadoop), cloud (OpenStack), and layered applications is a combination of Metal-as-a-Service (MAAS) and Juju.  These exciting open-source projects, offer groundbreaking functionality and just got better in Ubuntu 13.10!

MAAS provisions hardware using existing and well established protocols such as IPMI.  Juju makes it easy to visualize, design, deploy and scale application infrastructures across multiple environments such as bare-metal hardware (for OpenStack or big data deployments) or as workloads on top of cloud infrastructure ecosystems like OpenStack, HP Cloud, Microsoft Azure, and Amazon AWS.

Juju coupled with MAAS is what enables the deployment of services on bare-metal hardware.  This blog post shows just how easy it is to get an Ubuntu 13.10 based MAAS cluster up and running, with Juju to deploy nodes running Ubuntu 12.04 LTS.

Since many of us do not have ready access to idle hardware, in this post, we will virtualize our physical servers to form our MAAS cluster (the irony is not lost 🙂 ).

For the record, this is not a production setup, but it provides a hands-on approach that is useful to understand MAAS and Juju functionality along with their complementary relationship.  This post supplements the existing MAAS and Juju documentation.  For that and more information on Juju and MAAS please visit juju.ubuntu.com and maas.ubuntu.com.

Prerequisites:

  • Have an Ubuntu Desktop (host machine) with external network access.

  • Download and install Virtual Machine Manager (VMM) on to your host machine.

  • Download Ubuntu Server 13.10 64-bit iso image.  Note: I plan append to this entry with steps to deploy a MAAS controller with Ubuntu 12.04 using the Cloud Tools Archive for Juju and MAAS.  The MAAS controller in this setup uses Ubuntu 13.10.

Step 1: Create your MAAS network in VMM

  • Edit -> Connection details

  • Select the Virtual Networks tab

  • Click on the ‘+’ to add a network and go through the wizard setting:

    • Name: maas

    • Network: new subnet (Make sure it doesn’t conflict with physical network or any other virtual networks!)

    • DISABLE DHCP (it’s enabled by default)

    • NAT (Do not bridge or host-only this network because you need to download pxe images later)

Step 2: Create MAAS Controller

  • Create a new virtual machine via VMM and install it from the Ubuntu Server 13.10 image.

    • Suggested specs of CPU: 1, RAM: 1GB, Disk space 30GB.

    • Select the ‘maas’ network from Step 1:

  • At Ubuntu Server boot, select “Multiple server install with MAAS.”  Walk through the install as suggested on the MAAS page.

  • Tip! DHCP will fail (as expected since we turned off KVM’s DHCP server earlier) so configure manually.  Give an IP address in the range you selected for your ‘maas’ network but don’t use .1 since it’s reserved for KVM’s virtual switch.  You can use the default netmask, gateway, and name server entries provided by the installer.  Of course this is subject to your environment.

  • Proceed by following the remaining steps as suggested on the MAAS page.

  • When asked, select “Create a new MAAS on this server.”

  • Finish the MAAS node installation as suggested on the MAAS page.

Step 3: Configure MAAS Controller

  • Log into the MAAS controller via KVM console (remember, it’s behind NAT) and run

sudo maas createsuperuser

It is best to accept the default login name of root.

  • Tip! Depending on your network speed it can take some time to download all supported Ubuntu images.  Here’s how to download just the Ubuntu 12.04 Precise image:

    • As sudo, edit the /etc/maas/import_pxe_files file as shown below and run the command to download the pxe files:

 

sudo maas-import-pxe-files

  • set up SSH tunnel

ssh -R 8080:localhost:80 <your_username>@<your_desktop>

Step 4: Configure the MAAS Controller network

  • Follow the instructions on the MAAS Cluster Configuration page.

  • You will have to fill in Broadcast, Router and IP range details.

  • Configure the cluster to manage DHCP and DNS and run:

sudo service maas-dhcp-server restart

sudo service maas-pserv restart

Step 5: Add node(s) to MAAS

  • Create another KVM instance and add it to the ‘maas’ network.

  • Install from your Ubuntu 13.10 Server ISO and select “Multiple server install with MAAS”.  Optionally, simply create a new VM, selecting the option “Network Boot (PXE)”. This will cause this new VM to PXE Boot from MAAS and enlist itself.

  • Tip! During DHCP discovery, the node should receive an IP address within your specified IP range which you established in Step 4.

  • Select “Specify MAAS by name or address” and enter your MAAS Controller information

  • Tip! It’s normal for the node to reboot (this is part of the MAAS node enlistment step) and register itself via cloud_init.  Once complete, the node will shut down.

  • Find the declared node in the MAAS GUI

  • Tip!  Set PXE as a boot option for the declared node via VMM.

  • Commission the node by selecting “Commission selected nodes” from the Bulk action dropdown menu and place a checkmark next to the newly declared node e.g. ‘xbeqp.master’ in my example:

  • The screen will update to show progress.

  • I have not configured wake-on-LAN in this setup (it’s outside the scope of this post) so you need to manually boot the node to complete the commissioning process.  The node should then move to “Ready” status in a matter of minutes.  The node will shut down again once it’s in the “Ready” state.

  • You can add additional nodes by repeating the process above.

  • Tip!  Use the fast installer to save some serious node deployment time.   Add the “use-fastpath-installer” tag to the node, or click the “Use the fast installer” button on the node page of the MAAS GUI.

Step 6: Set up Juju

Much of this section is already discussed in the existing documentation.  So I’ve tried to highlight the areas not covered in the existing publications that is specific to this setup.

Juju install

  • Follow the published install and quick-start guide to set up Juju.

  • Tip! If you receive “sudo: add-apt-repository: command not found” during the Juju install step run “sudo apt-get install software-properties-common” and try “sudo add-apt-repository ppa:juju/stable” again.

  • In this setup, we are only installing nodes with Ubuntu 12.04 (“precise”)

Juju bootstrap

  • Once you’ve run “juju bootstrap –upload-tools” from the MAAS Controller, the MAAS GUI will show the node as allocated (a section of the pie chart will go from green to light blue) as shown in the two screenshots below.  The first screenshot shows only one node in the MAAS cluster and the other showing multiple nodes in a MAAS cluster.


  • Tip!  There is no wake-on-LAN configuration set for the Juju bootstrap so you have to boot the node manually from VMM.  If the command is working, you should see the installation progressing on the node from the VMM graphical console.

 

Juju status

Summary

Congratulations!  You have an Ubuntu 13.10 based MAAS cluster up and running with Juju to deploy nodes running Ubuntu 12.04.  Happy deployment for all your scale-out workloads!

As I mentioned earlier, I will append this entry to show how to setup a 12.04 based MAAS controller using the Cloud Tool archive.

 

Ameet Paranjape
Canonical Sales Engineer

Appendix: Wake-on-LAN

MAAS handles virtual machine power management via the virsh power management type.  You have to manually configure the details for each node in order for MAAS to manage these virtual machines and turn them on/off automatically.

Ubuntu cloud

Ubuntu offers all the training, software infrastructure, tools, services and support you need for your public and private clouds.

Newsletter signup

Get the latest Ubuntu news and updates in your inbox.

By submitting this form, I confirm that I have read and agree to Canonical's Privacy Policy.

Related posts

DIY chiselled Ubuntu: crafting your own chiselled Ubuntu base image

In a previous post, I explained how we made our Ubuntu image 15 times smaller by chiselling a specific slice of Ubuntu for .NET developers. In this blog, I...

Open source cloud platform: meet OpenStack

Are you looking for an open source cloud platform and you don’t know where to start? Are you getting lost in all the independent rankings and cloud platform...

Let’s build a snap together – a complex snapcraft.yaml walkthrough

It has been a while since we talked about how to build snaps. In the past, we went through a number of detailed examples, focused on different programming...