“Ubuntu 16.04 LTS Maas Server – part 1/8”

or we can view ubuntu-16-04-lts

For more informations about MAAS (Metal As A Service) we can view this link:

https://maas.io/

or we can view this video

UBUNTU MAAS (METAL-AS-A-SERVICE)

1 STEP – INSTALL UBUNTU MAAS

There are three ways to install Ubuntu MAAS and here are reported that ones:

After we’ve decided which type of procedure of using for our installation, we can follow step-by-step the instructions reported on its own web site:

  • Access the MAAS UI at http://maas.ip/MAAS/ and follow the instructions to create the administrator, then login with those credentials
  • Import disk images for 16.04 LTS 64 bit
  • Add your SSH key to your user profile – http://maas.ip/MAAS/account/prefs/
  • Copy the MAAS key – you will need this later
  • Fill in the other details, like gateway and DNS, in the networks that were auto-created for each NIC

Next we need configure the MAAS cluster:

  • Click on the ‘Clusters’ tab and select ‘Cluster master’
  • You will see a list of network interfaces on the machine, click the edit symbol for the interface that is connected to the private network where all the nodes are visible
  • Set this interface to manage DHCP and DNS
  • Set the ‘Router IP’ to the default gateway for this private network
  • Fill in details for the dynamic and static ranges, remembering to leave gaps for the floating IPs
  • Save the changes

Now we need to enlist and commission machines:

  • Ensure all machines are set to PXE boot, if possible disable all other boot options, including local disk, in the BIOS
  • Enlist the machines by powering them on. This can usually be done by some sort of virtual console. They will all appear in the node list in MAAS and be powered down again
  • Edit each machine in the nodes list and fill in the Power type and power parameters (i.e. username and password) so that MAAS can turn them on and off as needed
  • Select all of the machines and, using the Bulk action dropdown, Commission them
  • Wait until all machines are commissioned (i.e. in Ready state)

For our lab the installation of MAAS has been made selected the first way and used 2 vnet:

  • “vPrivate”: dedicated our virtual node network – 10.20.81.0/24;
  • “vPublic”: dedicated our external network – 10.20.82.0/24;

Screen Shot 2017-05-26 at 16.13.33.png

then run the ISO file

Screen Shot 2017-05-26 at 16.11.07.png

then continue until it’ll finish all tasks, at the end  we’ll have this MAAS installed on node. Once a time our Maas is installed correctly on node it’ll must have the network configured like that:

$: more /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The Primary network interface
auto ens32
iface ens32 inet static
 address 10.20.81.10
 netmask 255.255.255.0
 network 10.20.81.0
 broadcast 10.20.81.255
 gateway 10.20.81.254
 # dns-* options are implemented by the resolvconf package, if installed
 dns-nameservers 10.20.81.10 8.8.8.8
 dns-search maas
# The Secondary network interface
auto ens33
iface ens33 inet static
 address 10.20.82.10
 netmask 255.255.255.0
 network 10.20.82.0
 broadcast 10.20.82.255

2 STEP – ADD AND UPDATE MAAS VIA REPOSITORY PPA STABLE

Make the upgrade of MaaS to have the last stable release installed

$: sudo add-apt-repository -yu ppa:maas/stable
$: sudo apt update

3 STEP – UPGRADE UBUNTU MAAS

Run these commands

$: sudo apt update
$: apt list --upgradable -a
$: sudo apt dist-upgrade

 

now we’ll have our MAAS upgraded with last version, we can continue with its configuration. Using our browser we can view its dashboard, use the credentials created during the installation

Screen Shot 2017-05-26 at 16.38.06.png

after that

now we need to generate a ssh key. This task is done in this way

4 STEP – INSTALL LIBVIRT-BIN ON MAAS

Run this command to install Libvirt library

$: sudo apt-get install libvirt-bin

5 STEP – CONFIGURE SSH ACCESS ON MAAS

Then we need to create a secure access key

$: sudo mkdir /home/maas
$: sudo chown maas:maas /home/maas
$: sudo chsh -s /bin/bash maas
$: sudo su - maas 
maas@maas:~$

generate a secure ssh key

maas@maas:~$ ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/home/maas/.ssh/id_rsa): 
Created directory '/home/maas/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/maas/.ssh/id_rsa.
Your public key has been saved in /home/maas/.ssh/id_rsa.pub.
The key fingerprint is:
2b:6d:f9:ca:0f:bb:b8:3d:7d:4b:52:c3:57:d0:88:97 maas@maasmastersvr
The key's randomart image is:
+--[ RSA 4096]----+
| ..+ |
| . E..|
| . .|
| . . |
| S + . |
| . o . o |
| . *.. . |
| *.+.o. |
| o.*=o... |
+-----------------+

now copy it to host machine (our PC)

maas@maas:~$ ssh-copy-id -i ~/.ssh/id_rsa dakj@10.20.40.16
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
dakj@10.20.40.16's password: 

Number of key(s) added: 1

Now try logging into the machine, with: "ssh 'dakj@10.20.40.16'"
and check to make sure that only the key(s) you wanted were added.

then

maas@maas:~$: cat .ssh/id_rsa.pub

copy its result on Maas dashboard

now lets go with last task.

6 STEP – CONFIGURE DNS/DHCP SERVICE ON MAAS

To active DNS and DHCP service we need to active that service on the network set with eth0 (10.20.81.0/24). From “Subnets” tab selecting “fabric-0” and then as VLAN “untagged”:

when also that task is done we can add the node for Juju.

07 – SET THE SAME TIME ZONE ON NODES

On Maas server edit the file /etc/maas/preseeds/curtin_userdata, right after the lines:

late_commands:
maas: [wget, '--no-proxy', {{node_disable_pxe_url|escape.json}}, '--post-data', {{node_disable_pxe_data|escape.json}}, '-O', '/dev/null']

and add something like:

late_commands:
maas: [wget, '--no-proxy', {{node_disable_pxe_url|escape.json}}, '--post-data', {{node_disable_pxe_data|escape.json}}, '-O', '/dev/null']
setup_timezone_01: ["curtin", "in-target", "--", "sh", "-c", "rm /etc/localtime && ln -s /usr/share/zoneinfo/Europe/Rome /etc/localtime"]

save and close it, now we can add the nodes on Maas.

8 STEP – ADD NODE TO MAAS

From our VMware ESX Client create a new vm and run its deploy

Screen Shot 2017-05-26 at 17.01.25.png

being our lab built using  a VMware ESXi environment for making the boot of the node via Maas we need to follow this guide:

“How to configure Maas to be able to boot the vm VMware ESXi on Ubuntu 16.04 LTS Server Edition”

configured that in this way we can commit it

Screen Shot 2017-05-26 at 17.03.46

after we have added our node we need to commit it in a way that will have as status ready

Screen Shot 2017-05-26 at 17.09.20

as shown here

Screen Shot 2017-05-26 at 17.12.24

the first part is done see you to next one.

part 2/8 ->


“cya to the next 1…. Njoy !”
bye dakj

Disclaimer: All the tutorials included on this site are performed in a lab environment to simulate a real world production scenario. As everything is done to provide the most accurate steps to date, we take no responsibility if you implement any of these steps in a production environment.

“We learn from our mistakes”

Advertisements