How to get MAAS up and running

It seems to have worked for me by just eliminating the entire offending argument. Like this…

sudo maas init region+rack --database-uri “postgres://$MAAS_DBUSER:$MAAS_DBPASS@$HOSTNAME/$MAAS_DBNAME”

Whether this leaves MAAS unlinked to a DB, I’m not sure but I was able to login to the web gui. The command without the argument will automatically run through the admincreate script, unless switched off. I also noticed when trying to install 3.4 from deb, there is no command in the man pages for the offending argument. When I attempted to use the db name “maasdb” it errored out and said it already existed on a fresh attempt. Does 3.4 autocreate the postgresql during apt install of MAAS? I’m currently testing how it works if I manually upgrade postgresql to v14 and pre-create the DB. I’m hoping the MAAS install sees it and uses it by default with the db name “maasdb.”

Two things:

  • after editing pg_hba.conf I had to sudo service postgresql restart otherwise maas init failed
  • I’m stuck on maas $PROFILE subnet read $SUBNET_CIDR | grep fabric_id since there is no explanation of how to set SUBNET_CIDR

thanks for spotting the issue @rgarcia2009 !

In the meantime, you can list the existing subnets with maas $PROFILE subnets read and extract the CIDR of the subnet you want

I think for

  1. Import your selected image(s):
    maas admin boot-resources import

it should be (for consistency)

  1. Import your selected image(s):
    maas $PROFILE boot-resources import

*Would have made the edit, but discourse wouldn’t let me

Hello,

@billwear, the command for creating an admin user as in step 5 didn’t work for me. Seems like createadmin should be one word.

sudo maas createadmin --username=$PROFILE --email=$EMAIL_ADDRESS

Thank you!

1 Like

Post install, Step 3 should be ‘scram-sha-256’ and not ‘md5’ as that is now upgraded in pg14.

SCRAM-SHA-256 is the default for pg14+
md5 is the default for pg13-

If you did the basic CREATE USER command then it will use sha256 unless you specified.

How to unistall this tool ?
or how to deactivate maas server from the command line ?

thank you :slight_smile:

If you want to stop MAAS you can

sudo snap stop maas

if you want to uninstall it

sudo snap remove --purge maas

Looks like untagged is not accepted and required the vid of the vlan instead.

maas $PROFILE vlan update $FABRIC_ID untagged dhcp_on=True primary_rack=$PRIMARY_RACK_CONTROLLER                                                                                                                                                                                                                            
Unknown API endpoint: /MAAS/api/2.0/fabrics/vlans/untagged/.

Ubuntu 24.04.4 LTS

maas 3.7.2

I’m following the install document and getting this error:

unrecognized arguments: region+rack --database-uri "postgres://maas:[secret]@localhost"

How to proceed from here?

Are you using debs or snap?

I’m using debs from PPA

The init command is just for snaps. If you use debs you can install components individually. If you simply install the maas package you’ll get postgres and it will be initialized automatically. In short, you don’t have to execute the init command at all

1 Like

Thanks for the clarification!

More trouble trying to get 3.7 up and running following the install document:

# maas status
usage: maas [-h] COMMAND ...

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

drill down:
  COMMAND
    login         Log in to a remote API, and remember its description and credentials.
    logout        Log out of a remote API, purging any stored credentials.
    list          List remote APIs that have been logged-in to.
    refresh       Refresh the API descriptions of all profiles.
    init          Initialize controller.
    apikey        Used to manage a user's API keys. Shows existing keys unless --generate or --delete is passed.
    configauth    Configure external authentication.
    config-tls    Configure MAAS Region TLS.
    config-vault  Configure MAAS Region Vault integration.
    msm           Configure enrolment with a Site Manager instance
    createadmin   Create a MAAS administrator account.
    changepassword
                  Change a MAAS user's password.

https://maas.io/

argument COMMAND: invalid choice: 'status' (choose from 'login', 'logout', 'list', 'refresh', 'init', 'apikey', 'configauth', 'config-tls', 'config-vault', 'msm', 'createadmin', 'changepassword')

and this:

# maas createadmin --username=first.last --email=first.last@example.com
usage: maas [-h] COMMAND ...

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

drill down:
  COMMAND
    login         Log in to a remote API, and remember its description and credentials.
    logout        Log out of a remote API, purging any stored credentials.
    list          List remote APIs that have been logged-in to.
    refresh       Refresh the API descriptions of all profiles.
    init          Initialize controller.
    apikey        Used to manage a user's API keys. Shows existing keys unless --generate or --delete is passed.
    configauth    Configure external authentication.
    config-tls    Configure MAAS Region TLS.
    config-vault  Configure MAAS Region Vault integration.
    msm           Configure enrolment with a Site Manager instance
    createadmin   Create a MAAS administrator account.
    changepassword
                  Change a MAAS user's password.

https://maas.io/

connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL:  password authentication failed for user "maas"
connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL:  password authentication failed for user "maas"

Having learned from my past mistake, I thought maybe these commands were only necessary for a snap install, so I tried navigating to http://[server.ip]:5240/maas. The good new is nginx is listening on that port. The bad news is that the page was not found.

I feel like I’m following the wrong document.

Look like the database is not healthy

I haven’t done anything with the database except what’s in the install document. Is there another document that works better with maas 3.7?

No. I’d suggest you to start from scratch

sudo DEBIAN_FRONTEND=noninteractive apt remove --purge -y 'maas*' 'postgresql*' && sudo DEBIAN_FRONTEND=noninteractive apt -y autoremove

and

sudo apt-add-repository ppa:maas/3.7
sudo apt update
sudo apt -y install maas