Skip to main content

Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting us. A member of our team will be in touch shortly. Close

  1. Blog
  2. Article

Canonical
on 19 November 2013

MAAS and Juju in a VM on Ubuntu 12.04 LTS – Part 2


Enterprise environments rely on Ubuntu’s LTS (Long-term Support) release.   Its established two year release cadence and five year security and maintenance updates means sysadmins and developers can plan updates and migrations in advance. So it comes at no surprise, Ubuntu 12.04 LTS is the leading reference operating system for OpenStack development and deployments.

Ubuntu’s Metal-as-a-Service (MAAS) and Juju tools provide the most mature method of  deploying OpenStack on Ubuntu 12.04 LTS in a High availability (HA) configuration, with an established upgrade path to the latest version of OpenStack using Cloud Archive.  You get the longevity and stability of Ubuntu LTS with the capability of running the latest OpenStack features.

This blog post shows you how to set up an Ubuntu 12.04 LTS based MAAS cluster with Juju to deploy nodes running Ubuntu 12.04.  In this setup, we use the enterprise standard of Ubuntu 12.04 LTS to deploy the MAAS Controller.

As mentioned in my previous post from a few days ago – “Interested in MAAS and Juju; Here’s how to try it in a VM”, Juju coupled with MAAS enables the deployment of services on baremetal hardware.  Since many of us do not have ready access to idle hardware, in this post, we will virtualize our baremetal servers to form our MAAS cluster (again, 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 a Ubuntu Desktop (host machine) with external network access.

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

  • Download Ubuntu Server 12.04 64-bit iso image.

 

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 12.04 LTS  image.

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

    • Select the ‘maas’ network from Step 1:

  • At Ubuntu Server boot, select “Install Ubuntu Server” and run through a default Ubuntu server installation.

  • 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 entries provided by the installer for the remainder of the install, but this is subject to your environment.

  • Once Ubuntu server is installed, login to the system and add the Cloud Tools Archive repository

    sudo add-apt-repository cloud-archive:tools

Tip!  If you receive  “sudo: add-apt-repository: command not found,”  try “sudo apt-get install python-software-properties” and try the above command again.

    sudo apt-get update

  • Install MAAS packages from the Cloud Tools Archive

    sudo apt-get install maas

  •    Finish the MAAS node installation as suggested in the Install Packages section of the Install packages from the archive 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

Tip!  Check in /var/lib/maas/ephemeral/precise/ephemeral for the downloaded precise images.

  • 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 mas-pserv restart
Step 5: Add node(s) to MAAS

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

  • Install from your Ubuntu 12.04 LTS 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.

  • Find the declared node in the MAAS GUI

  • Tip!  Set Network (PXE) as the first boot option and Hard Disk as second 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.  The node will shutdown during the commissioning step.

  • 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 configure and run Juju.  Remember we are installing the juju-core package from the Cloud Tools Archive.

  • 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 12.04 LTS based MAAS cluster up and running with Juju to deploy nodes running Ubuntu 12.04.  Happy deployment for all your scale-out workloads!

 

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.

Related posts


Rhys Knipe
23 December 2024

What to know when procuring Linux laptops

Ubuntu Article

Technology procurement directly influences business success. The equipment you procure will determine how your teams deliver projects and contribute to your success. So what does being “well-equipped” look like in the world of Linux laptops?  In this blog, we’ll lay down the best practices for procurement professionals who have been taske ...


Michelle Anne Tabirao
20 December 2024

Building RAG with enterprise open source AI infrastructure

Data Platform Article

How to create a robust enterprise AI infrastructure for RAG systems using open source tooling?A highlight on how open source can help ...


Amir Abdel Baki
19 December 2024

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Ubuntu Article

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing ...