MAAS: Difference between revisions

From Omnia
Jump to navigation Jump to search
 
Line 179: Line 179:
* To use an SSH key associated with your launchpad accounts, enter lp:$USERNAME (substitute your LP username for $USERNAME).
* To use an SSH key associated with your launchpad accounts, enter lp:$USERNAME (substitute your LP username for $USERNAME).
* Alternatively, to use an SSH key associated with your github account, enter gh:$USERNAME (substitute your github username for $USERNAME)
* Alternatively, to use an SSH key associated with your github account, enter gh:$USERNAME (substitute your github username for $USERNAME)
--
To change password:
sudo mass changepassword [USER]


=== Check MAAS status ===
=== Check MAAS status ===

Latest revision as of 20:24, 4 February 2024

MAAS

MAAS | Metal as a Service
https://maas.io/
Very fast server provisioning for your data centre
Self-service, remote installation of Windows, CentOS, ESXi and Ubuntu on real servers turns your data centre into a bare metal cloud.
Welcome to metal-as-a-service.
Data centre automation
Your next rack is a bare metal cloud.
Metal-As-A-Service (MAAS) provisioning with Windows, ESXi, Linux.
  • Bare metal cloud with on-demand servers
  • Remote edge cluster operations
  • Infrastructure monitoring and discovery
  • Ansible, Chef, Puppet, SALT, Juju integration
  • Super fast install from scratch
  • VMWare ESXi, Windows, CentOS, RHEL, Ubuntu
  • Custom images with pre-installed apps
  • Disk and network configuration
  • API-driven DHCP, DNS, PXE, IPAM
  • REST API for provisioning
  • LDAP user authentication
  • Role-based access control (RBAC)
  • Hardware testing and commissioning

Github

maas/maas: Official MAAS repository mirror (may be out of date). Development happens in Launchpad (https://git.launchpad.net/maas/).
https://github.com/maas/maas

Metal as a Service -- MAAS -- lets you treat physical servers like virtual machines in the cloud. Rather than having to manage each server individually, MAAS turns your bare metal into an elastic cloud-like resource.

What does that mean in practice? Tell MAAS about the machines you want it to manage and it will boot them, check the hardware's okay, and have them waiting for when you need them. You can then pull nodes up, tear them down and redeploy them at will; just as you can with virtual machines in the cloud.

When you're ready to deploy a service, MAAS gives your tool of choice (e.g. Ansible, Chef, Puppet, SALT, Juju) the nodes it needs to power that service. It's as simple as that: no need to manually provision, check and, afterwards, clean-up. As your needs change, you can easily scale services up or down. Need more power for your Hadoop cluster for a few hours? Simply tear down one of your Nova compute nodes and redeploy it to Hadoop. When you're done, it's just as easy to give the node back to Nova.

MAAS is ideal where you want the flexibility of the cloud, and the hassle-free power of Juju charms, but you need to deploy to bare metal.

For more information see the MAAS guide - https://maas.io/

Setup MAAS

Setting and using up MAAS - JOID - OPNFV Wiki - https://wiki.opnfv.org/display/joid/Setting+and+using+up+MAAS

Nodes Networking: Deploying OpenStack on MAAS 1.9+ with Juju | Ubuntu blog - https://blog.ubuntu.com/2016/01/31/nodes-networking-deploying-openstack-on-maas-1-9-with-juju

pronouncebale machine names

I understand that sabdfl specifically requested 5-character machine names in MAAS (rather than MAC or IP based names like AWS).

I'd like to make an additional request from a usability perspective... Can we please make the MAAS machine names pronounceable? It's really, really difficult to talk about machines in a cluster when the name is "kslnw" or "xpxrqm".

Here's a suggestion:

$ sudo apt-get install wamerican
$ shuf -n 1 /usr/share/dict/american-english | sed 's/[^a-zA-Z]//g'

That gives much more readable, though still random, machine names. That dictionary has 100K words in it. There's also wbritish, wcanadian. See the scowl source package or http://wordlist.sourceforge.net/ for more information.

Ref: Bug #1287224 “MAAS random generated hostnames are not pronouncea...” : Bugs : MAAS - https://bugs.launchpad.net/maas/+bug/1287224

Install

MAAS | How to install MAAS
https://maas.io/docs/fresh-installation-of-maas

Install 3.4 Snap

As of 2024.02.03:

sudo snap install --channel=3.4 maas

Init

maas init
usage: maas init [-h] {region+rack,region,rack} ...

Initialise MAAS in the specified run mode.

options:
  -h, --help            show this help message and exit

run modes:
  {region+rack,region,rack}
    region+rack         Both region and rack controllers
    region              Region controller only
    rack                Rack controller only

When installing region or rack+region modes, MAAS needs a
PostgreSQL database to connect to.

If you want to set up PostgreSQL for a non-production deployment on
this machine, and configure it for use with MAAS, you can install
the maas-test-db snap before running 'maas init':

    sudo snap install maas-test-db
    sudo maas init region+rack --database-uri maas-test-db:///

the following arguments are required: run_mode

Database

__ Production rig (Snap) __

Install Postgres:

sudo apt update -y
sudo apt install -y postgresql

Set Variables:

MAAS_DBUSER="massuser"
MAAS_DBPASS="maaspass"
MAAS_DBNAME="massdb"
HOSTNAME="localhost"

Create DB User:

sudo -i -u postgres psql -c "CREATE USER \"$MAAS_DBUSER\" WITH ENCRYPTED PASSWORD '$MAAS_DBPASS'"

Create Database:

sudo -i -u postgres createdb -O "$MAAS_DBUSER" "$MAAS_DBNAME"

Edit /etc/postgresql/14/main/pg_hba.conf: (replace with values)

host    $MAAS_DBNAME    $MAAS_DBUSER    0/0     md5

Rack + Region

Initialise MAAS:

sudo maas init region+rack --database-uri "postgres://$MAAS_DBUSER:$MAAS_DBPASS@$HOSTNAME/$MAAS_DBNAME"
MAAS URL [default=http://10.x.x.x:5240/MAAS]:
MAAS has been set up.

If you want to configure external authentication or use
MAAS with Canonical RBAC, please run

  sudo maas configauth

To create admins when not using external authentication, run

  sudo maas createadmin

To enable TLS for secured communication, please run

  sudo maas config-tls enable

Rack Controller

__ Distributed env (Deb) __

To run MAAS region and rack controllers on separate machines:

Add the MAAS 3.3 PPA on both region and rack target:

sudo apt-add-repository ppa:maas/3.3
sudo apt update

Region Controller Target:

sudo apt install maas-region-controller

Rack Controller Target:

sudo apt install maas-rack-controller

Register Rack with Region Controller:

sudo maas-rack register

Create Admin

Create admin user to access web UI:

sudo maas createadmin --username=$PROFILE --email=$EMAIL_ADDRESS
  • To use an SSH key associated with your launchpad accounts, enter lp:$USERNAME (substitute your LP username for $USERNAME).
  • Alternatively, to use an SSH key associated with your github account, enter gh:$USERNAME (substitute your github username for $USERNAME)

--

To change password:

sudo mass changepassword [USER]

Check MAAS status

sudo maas status

Configure via Web

http://${API_HOST}:5240/MAAS

Configure CLI

Once Web configured...

sudo maas apikey --username=$PROFILE > api-key-file
maas login $PROFILE $MAAS_URL < api-key-file

keywords