Embedding generic metadata in the balenaOS image

Hi guys not sure if this is the place to ask this.

I’m wondering if it is possible to pass in some data to the balenaOS image, so that when a device is provisioned, we can subsequently use that information for things like, e.g. having the device tag itself. As a simple example, each customer might have a particular name we keep track of, and we also want to know what device belongs to what name, since we may have many devices and it becomes easy to lose track of. My initial idea was that as part of our signup process, we download the balenaOS, the customer types in their name, and we subsequently embed that information into the balenaOS image, which we can then use to tag the device via the balena API, after being provisioned.

I’m not sure if this is already provided or if this is even possible, but it’s definitely a use case we are looking at it and would love to know. If this isn’t currently supported, could you possibly recommend a potential solution to how we might achieve this?

Regards, Sebastian

Hey, currently this isn’t something that we support. We have plans to add preloading of data volumes, in which you could add some data to the device when flashing the image. This, unfortunately, isn’t ready yet.

I’m going to add an internal tracking issue for this, so we can discuss it and hopefully come to a resolution.

In terms of what you can do right now, I’m not too sure. My method would be to tag the device as it provisioned, but it’s not the best.

Hi @Seb1,

We’ve created a custom provisioning server that provisions our devices after it’s provisioned with cloudBalena/openBalena. Our device first checks locally if the device is provisioned (if it has any data), and if not, it’s setting up some requests to our provisioning server so that it get’s a serialnumber etcetera. It also communicates via the Balena API to cloudBalena/openBalena (API is the same) to set the serialnumber there, amongst other things.

Of course this requires setting up your own server and creating some software for it, but it seems to work quite well for us. Maybe this is something you can do too.

Thanks guys, we’ll look into rolling our own custom solution, but I’d love to hear if you guys have an ETA on implementing this as a feature.


unfortunately we don’t have an ETA for this feature. But we will ping you in this thread once the feature will be discussed / implemented.

1 Like