Deploy MAAS(7)

TurnToJPG -->

This will record the complete steps for deploying MAAS in a newly installed machine.


The start point should be at Ubuntu14.04.

$ sudo add-apt-repository  ppa:maas-maintainers/maas-test
$ sudo vim /etc/apt/sources.list
# Add maas repository
deb trusty main
deb-src trusty main
$ sudo add-apt-repository ppa:juju/stable
$ sudo vim /etc/apt/sources.list
# Add juju repository
deb trusty main 
deb-src trusty main 
$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install maas-test maas-dhcp maas-dns juju juju-core juju-local juju-quickstart firefox git

Tips: for enable the vncserver on Ubuntu, do following:

$ sudo apt-get install tightvncserver lxde
$ vncserver
$ vim ~/.vnc/xstartup

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
# /etc/X11/Xsession
startlxde &
$ vncserver -kill :1 && vncserver

The MAAS Controller relies on a google’s theme which is blocked by GFW, so we have to use proxychains for acrossing it, please notice these operation could be done on host machine, or Maas Controller itself..

$ git clone 
$ ./configure --prefix=/usr && make && make install
$ sudo cp src/proxychain4.conf /etc
$ sudo vim /etc/proxychains4.conf
$ sudo apt-get install midori
$ proxychains4 midori

Configure the MAAS Controller via:

$ sudo maas-region-admin createadmin
[sudo] password for Trusty: 
Username: root
Email: root@localhost

This enabled the admin username/password, refresh the you could login to the MAAS Controller.


Image Configuration

First download the images fromt the official repository via(On MaasController):

$ sudo apt-get install simplestreams ubuntu-cloudimage-keyring apache2
$ sudo bash
# proxychains4 sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg /var/www/html/maas/images/ephemeral-v2/daily 'arch=amd64' 'subarch~(generic|hwe-t)' 'release~(trusty|precise)' --max=1
$ pwd
$ sudo mv ephemeral-v2/ ephemeral-v2.back
[sudo] password for Trusty: 
$ sudo tar xjf /home/Trusty/ephemeral-v2.tar.bz2 -C ./

Then Change the configuration in browser of opened

Click Configuration Button, and update the Ubuntu -> Main archive (required) from: 
This repository enable the installed system for retrieving the install packages, use aliyun we could get much more faster speed.

Change the Boot Images -> Sync URL (required) from: 
This will enable the Boot Images Sync URLs, use local repository will greatly improve the bootup speed.

Network Configuration

Since the midori’s effect is not good, install qupzilla:

$ sudo apt-get install qupzilla
$ proxychains4 quazilla

Under Cluster->Interfaces->eth0->Edit, change it to Management(DNS and DHCP), and then modify following items:

MAAS ssh key should be generated via following steps:

Trusty@MassController:~$ sudo mkdir /home/maas
[sudo] password for Trusty: 
Trusty@MassController:~$ sudo chown maas:maas /home/maas/
Trusty@MassController:~$ sudo chsh maas
Changing the login shell for maas
Enter the new value, or press ENTER for the default
        Login Shell [/bin/false]: /bin/bash
Trusty@MassController:~$ sudo su - maas
maas@MassController:~$ ssh-keygen 
Generating public/private rsa key pair.

Copy the generated key to And remember the api-key, for later we will use it for generating nodes information.
Enable the remote control of your host’s libvirt:

$ sudo apt-get install libvirt-bin
maas@MassController:~$ ssh-copy-id root@
maas@MassController:~$ virsh -c qemu+ssh://root@ list  --all
 Id    Name                           State
 2     MaasController                 running
 -     Ubuntu1404Maas                 shut off
 -     Ubuntu203                      shut off

Also we have to configure the network under

Also we should manually edit the MaasController’s network configuration via:

$ cat /etc/network/interfaces
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
# iface eth0 inet dhcp
iface eth0 inet static                                                                                                                        
        # dns-* options are implemented by the resolvconf package, if installed                                                               

Restart and the network configuration is OK, notice only we set as the dns server, we could enable the local FQDN.

Add Nodes

Create the vm in virt-manager, its start-up is via PXE, and with 3G Mem, 60G space, 2-Core which copies the Host CPU.
Then in browser edit like following:
Then in the Nodes, select the node, and commision selected node.After commission, the status will be changed to ready.

Juju Configuration

Use following command for quickstart juju:

$ juju-quickstart -i

The configuration image is listed as:

Generate the local tools:

$ mkdir .juju/metadata
Trusty@MassController:~$ juju metadata generate-tools -d ~/.juju/metadata

Then start the node via:

$ juju bootstrap --metadata-source ~/.juju/metadata --upload-tools -v --show-log --constraints="mem=3G"

After it success, the juju and MAAS environment is ready for use.