Enforce single distro on device without differing device type

Hi,

I have a question about how to use some of the device type/artifact constructs. I have two devices with identical hardware and therefore share the same device type. I want to lock one machine to only get artifacts which satisfy certain conditions. For example, Device A has Distro X and should only ever get versions of Distro X, while Device B has Distro Y and should only ever get versions of Distro Y. Is there a way I can enforce this? Is it desirable to make them different device types even though they have the same hardware, or is there some sort of thing I can check before the “artifact install” state which I can check to block undesired behavior?

Hi @logbaseaofn,

This is possible by using device groups. If you want to match on a specific attribute this would require the dynamic grouping feature, which is only available on the Professional and Enterprise plans.

Let me know if I can help you with anything else!

Greetz,
Josef

Hi, @TheYoctoJester

I am currently an enterprise customer. I am looking for a way to enforce on the device since we offer the ability to update over USB which just installs a given mender artifact.

Hi @logbaseaofn,

I think this is the best approach. Despite using the same hardware, they count as different devices for your business model. If you need to target both devices (for example, any security patch), it will be as easy as making the artifact compatible with both devices.

For example, if you create an artifact containing only some text files, it will probably be compatible with any architecture. Still, if you require to make sure it reaches only one specific type of device, you should make it “compatible” only with this device at the artifact level. This is because the device concept in Mender is related not only to real hardware but also to your business needs.

A second option is to use State Scripts to check what distro you are running and abort the installation if needed; however, if you are OK with using two “types” of devices, then that option is more straightforward and involves less over-engineering.

Hi, @Iramirez

This sounds good. I will speak with my colleagues on how we can best implement this. I assume if we wanted to over-engineer it, before reboot the new rootfs is on the inactive partition so I can just mount it and do any checks like that? I agree that having different device types may be the way to go. Is there any supported way of changing device types of devices in the field? Or is that something we have to hack into an update?

@logbaseaofn perhaps this is interesting to you as well? :slight_smile:

This could certainly work if an artifact can provide multiple things - then I could provide some sort of identifier which can be depended upon for the distro-specific artifacts. I’ll look into it more as soon as I am able. Good find, thank you!

1 Like