MAAS Deploy(2)

TurnToJPG -->

We just continue to use MAAS for deploying cluster.


Install following packages for enable local installation repository:

$ sudo apt-get install simplestreams ubuntu-cloudimage-keyring apache2
$ sudo apt-get install iptraf nethogs

Run following commands for importing the images of mass from official repository to local webserver.

root@MassTestOnUbuntu1404:~# 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

If you have the pre-downloaded packages, simply de-compress it to the corresponding directory.

root@MassTestOnUbuntu1404:/var/www/html/maas/images# mv ephemeral-v2/ ephemeral-v2.back
root@MassTestOnUbuntu1404:/var/www/html/maas/images# tar xjvf /home/Trusty/ephemeral-v2.tar.bz2  -C ./

After de-compression, your local image service could be detected via visit following webpage:

Visit following webpage, then edit the default gateway and the DNS server:
Default GateWay:
DNS Servers:
Then Save Network can let you save your network configuration.

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.

Now build the Images like following images:

After a while, your Boot Image will be ready.

Add Maas Ssh Key

Do following steps for generate the ssh key pairs for user maas:

$ sudo mkdir /home/maas
$ sudo chown maas:maas /home/maas/
$ 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@MassTestOnUbuntu1404:~$ sudo su - maas
maas@MassTestOnUbuntu1404:~$ ssh-keygen 
Generating public/private rsa key pair.

After these steps, copy the /home/maas/.ssh/ to your clipboard, then copy it under:
Now the ssh-key has been added into your MAAS system.

You could also copy the api key of your maas, later we will use it.
Mine is: ntQBr8QTPgeTyfYuMq:HGKFChwM65QXtABNS4:SK7bnuGNDN7fLB9k7HNspYLch4kc6RLs

Now the maas controller is ready, next step is create the virtual machine and let it be managed by controller.