Categories: BlogCanonicalUbuntu

MAAS 3.1: Bare metal provisioning of hot metal

Back a few months ago, we did a feature poll on our MAAS forum, and the most-requested new feature turned out to be “Recommission/rescan a machine after it has been deployed“. With the release of MAAS 3.1, we’ve added that feature. Here’s a sample of how it works.

Start with any old machine

In the Developer Advocate‘s lab, we have a stack of NUCs and a bunch of different laptops. For this exercise, we chose a gaming laptop because:

  1. it’s fully loaded: Ryzen 7, 16GB RAM, a couple TB of space, etc., hooked up via Ethernet to a 1GB+ internet connection.
  2. Sponsored
  3. it’s likely to be something a lot of developers would probably have nearby, making it easier to duplicate this experiment in odd moments.

We freshly installed and initialized MAAS 3.1 and LXD, just following the instructions — except that we didn’t disable DHCP/DNS on LXD, and we didn’t enable DHCP on MAAS. This configuration shows that MAAS doesn’t have to have DHCP enabled to manage machines that are already running — especially since it’s likely that a running machine already has a DHCP-assigned IP address, that it got from somewhere else.

Create and verify a LXD container

Using the command:

lxc launch ubuntu:20.04 u1

When the container is running, we can check it with:

A connected, running, independent lxd container

To demonstrate that the workload doesn’t get disturbed, we’ll do this:

A “top” session started just before enlisting this running machine

Capturing the hot metal

Using the “deployed=true” flag, we’ll enlist this machine into MAAS with the following command sequence:

stormrider@cloudburst:~$ maas admin machines create deployed=true hostname=u1 architecture=amd64 mac_addresses=00:16:3e:fc:71:98 power_type=manual 
Success.
Machine-readable output follows:
{
    "pool": {
        "name": "default",
        "description": "Default pool",
        "id": 0,
        "resource_uri": "/MAAS/api/2.0/resourcepool/0/"
    },
    "node_type": 0,
    "cache_sets": [],
    "volume_groups": [],
    "description": "",
    "status_action": null,
    "disable_ipv4": false,
    "other_test_status_name": "Unknown",
    "fqdn": "u1.maas",
    "boot_disk": null,
    "numanode_set": [
        {
            "index": 0,
            "memory": 0,
            "cores": [],
            "hugepages_set": []
....

Part of the (rather long) JSON response is shown to highight the fact MAAS has accepted the machine as deployed, but currently knows nothing about it. We can confirm this by looking at the machine list:

The lxd container has been enlisted by maas as a deployed machine

We can further confirm the lack of commissioning data by zooming in on the newly-enlisted machine:

Note the number of “Unknown” values for the newly-enlisted machine

Did we disturb the machine?

We can check the running “top” command on the newly-enlisted machine to make sure nothing’s been disturbed:

The “top” command is still running, completely oblivious to machine enlistment by maas

Indeed, the machine doesn’t even seem to notice that it’s been enlisted by MAAS — at least, not in terms of impact on the workload.

Sponsored

Updating hardware information

Of course, just knowing the machine is connected to MAAS doesn’t do much for us. What we really need is to update the hardware information — but we want to do that without disturbing the workload significantly.

To accomplish this, we’ll log onto the machine with in a different window and download the “maas-run-scripts” to the machine:

Downloading and setting run permissions for the maas-run-scripts

Here, we’ve not only downloaded the scripts, we’ve actually set permissions so the scripts can run. To run the script to gather hardware information, though, we’ll need some authentication information, from MAAS, about the machine. Back on the MAAS host, we’ll run this command:

Maas authenication information for the newly-enlisted maas machine

We’ll create a credentials file called “u1-creds.yaml” that looks like this:

root@u1:~# cat u1-creds.yaml
reporting:
        maas:
                consumer_key: UUy9RkZt5gLcC7db6S
                endpoint: http://192.168.1.107:5240/MAAS/metadata/status/8gf6sb
                token_key: 44mZe589X3kzew4qrr
                token_secret: 5yKB33R99NYpQ2ZZEJrXZQGFjhe4aPQz

Before we run the command to collect hardware information, let’s check our “top” process to make sure it’s still running properly:

The “top” session is still running undisturbed

With these creds in place, we can run the following (just-downloaded) command to update MAAS about this machine’s hardware info:

Using maas-run-scripts to gather hardware info and send it to maas

Let’s check on that “top” process one more time:

The load average rose from 0. 53 to 0. 62 during the scan, which is miniscule

Good. The machine hasn’t been disturbed much, if at all. Now, let’s see if MAAS knows more about this machine:

Maas 3. 1: bare metal provisioning of hot metal 12

You can see from this that MAAS has learned, as of MAAS 3.1, to enlist running machines, that is, to deploy hot metal, without disturbing its workload.

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

3 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

4 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

6 days ago