Approach to integrate existing Ubuntu servers into Mender

DELFAR45
Thu, 23 Nov 2023 17:02:37 +0000
Debian family

The servers / Situation

I’ve got appliances in the field and new appliances being built running Ubuntu Server on a single disk with the following partitions:

UEFI/GRUB boot partition (1GB)

Rootfs Partition A containing kernel and all data (~400GB)

Rootfs Partition B empty ext4 partition (~30GB)

The B partition is only prepared to give us an upgrade path in the future as the current deployment is managed using a configuration management tool. We’re having scaling issues with that tool, there’s no fallback and that’s why we are considering using Mender.

What I want

Switch to Mender for the Firmware Update/UI/Signing/Azure IoT integration features and more

Upgrade my server firmware with fallback (A/B partition)

Outline a process to switch to Mender for servers described above that are already out in the field

Create a data partition and migrate existing data if possible (I could also upload the data before the migration to some bucket but if I don’t have to I’ll save time)

Not to brick any servers

Approach without Mender

1. Create a new image

2. Use dd/partclone to flash the image onto partition B

3. Use “update-grub” maybe with custom configuration to make sure B is the new A and A the new fallback

4. Boot into rootfs B partition

5. Shrink rootfs A partition

6. Create a data partition from the empty space

7. Mount the data partition and make sure my applications work

8. Create a new image for the rootfs partitions to include the mounts and other potential updates

9. Flash the new image onto rootfs partition A again using dd/partclone

10. Update grub again

11. Boot into partition A, and done

Obviously, this will be much more error-prone and lacks many features we’d like to have down the road. But it will work without calling back any servers, which is most important.

Question / Approach with Mender (?)

Below is my idea. I’m pretty sure this won’t work as it doesn’t seem possible, if I read the documentation correctly, to install the client and migrate partition B + Boot only at first.
So I’m looking for a process I can follow to make this happen.
Is this possible or do I have to look for other options?

1. Install mender software on my base image and convert the base image into a mender-compatible image using mender-convert

2. Install mender software on my server’s A rootfs partition

3. Update rootfs B partition and UEFI/GRUB partition only using mender software on A partition (Is this somehow possible?)

4. Boot into rootfs B partition

5. Shrink rootfs A partition

6. Create a data partition from the empty space

7. Mount the data partition and make sure my applications work

8. Create a new mender image for the rootfs partitions to include the mounts

9. Flash the new mender image onto rootfs partition A

10. Boot into partition A, and done

Resources

I found only this one approach that would translate to my situation: How to migrate live devices to Mender? - #10 by erikhh
But it has been 4 years, and it seems error-prone, and supporting the process I describe above seems possible (looking at this as a beginner)

5 posts - 2 participants