MAAS changed a partition on a deployed machine?!

I’m trying to get MAAS to deploy Ubuntu to a 100G partition on /dev/sda.

First I used the MAAS CLI to do this before deploying the machine:

maas admin machine set-storage-layout fan6y8 storage_layout=flat root_size=100G

That gave the expected output and so I was disappointed that when I deployed the machine (via the UI), the root partition instead used the entire disk. So, I guess the above command doesn’t really work?

To get around that first issue, I then put the machine into “rescue” mode using the MAAS and re-sized both the filesystem and partition. I was careful to verify that this was successful.

I then exited “rescue” mode using the MAAS UI and booted up the machine.

To my surprise, the root partition was again using all space on the disk! Why would MAAS decide to resize a partition of a deployed machine?

I’m new to MAAS (somebody else set it up who’s no longer with the company), but about ready to give up on it.

Are these known bugs with the version of MAAS I’m using?:

MAAS version: 2.4.2 (7034-g2f5deb8b8-0ubuntu1)

Any help would be appreciated. Thanks!

Hi @spockdude,

MAAS never changes anything on a deployed machine. What you are observing is likely caused by cloud-init. See https://cloudinit.readthedocs.io/en/latest/topics/modules.html#growpart about how to disable this

TL;DR: growing the root partition to fill the disk is the default behavior. You can disable this with preseeding.

1 Like

@alexsander-souza, thanks for your reply! It was super helpful as I was starting to think I had entered the twighlight zone.

I’m looking to find a good tutorial on cloud-init preseeding. It looks like creating a file in /etc/maas/preseeds is probably the answer. But, I’m still searching for a clear example of what a preseed file would look like that disables both growroot and growpart in cloud-init. Or, an example of any type of cloud-init preseed file for MAAS.

Well, I found this example of how to make cloud-init run a script after deploying:

How to pre-seed with cloud-init

But, it sounds like I need some way of overwriting the default cloud-init settings that MAAS uses.

the user-data can be either a script or cloud config data (https://cloudinit.readthedocs.io/en/latest/topics/format.html), the latter can be used to override default values

Just to wrap up this conversation, the solution to this ended up being pretty simple. Just make sure your disk layout doesn’t leave any empty space on the drive. (I’m sure the preseeding solution would work too, but I opted for a simpler solution.)

As a side note, I ended up abandoning my attempt to create a custom disk layout via the CLI. If I needed to deploy dozens of machines with the same custom disk layout, the CLI might be the way to go. But, I later realized that the RAID1+JBOD layout I was trying to create was pretty easy to do via the UI. I got off track by searches on customer storage layouts that all led to CLI solutions. But, if you only need the custom layout for a few machines, it’s definitely better (and really easy to do) via the UI. I hope that if I ever need to do this via the CLI that MAAS will have progressed to the point that creating custom storage layouts is not rocket science like it is as of 3.2.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.