Apply tags to devices based on image config

I have people deploying devices in two different places, I’d like to keep track of where the devices are deployed and who deployed them.
Is it possible to embed tags or configuration data in the config.json

I’d like to give the person at each location a different image to ensure I can keep track.

Hi Techplex,

We don’t have such a feature at the moment, we might have something to accomplish this in future! We’ll keep you posted when that happens.

Building on the original poster question, is there a common strategy people are using for large device zero touch rollouts where you want to be able to identify the device once it appears in the Cloud console. The location based on geoip just some guidance as to where the device is but it would be great to learn how others are identifying devices uniquely as they appear in the console. With an Intel NUC you could potentially track MAC address at time of shipping but not sure if that is exposed up through the Balena API. Also I don’t think this would scale down to RPi devices where MAC address is not barcoded on the device for example.

Hi cam415,

You can view any device’s MAC address from the balenaOS Host with something like ifconfig -a | grep HWaddr and the device UUID via $HOSTNAME, which you might be able to use to script a resulting table. Still, this isn’t ideal for large-scale deployments. As @iamsolankiamit mentioned, we’re tracking this feature requirement.

Best regards,
John

Thanks @jtonello for the follow up. I am wondering if your team has scoped out a solution for this requirement that you might be able to share some preliminary details. For large scale drop ship style deployments we are trying to figure out if Balena can help the onboarding process and being able to identify a specific device from the API would be critical. Creating a site-specific config.json file and modifying the hostname so it can be identified from the API would likely work. This creates a logistic challenge during the flashing of SD cards so I am interested in what you guys are thinking or whether there is a way to scale site-specific flashing.

Hi, just a thought here. You can use balena CLI to pre-configure a downloaded image. You can set things like device UUID, which would allow you to identify the device. See https://www.balena.io/docs/reference/balena-cli/#os-configure-image.
About scaling up site-specific flashing, we are working on the Etcher Pro device to fill this need. I will ask the Etcher Pro team whether the individual configuration feature is in the roadmap and come back to you.

Hi, so I had some internal discussion about this. There is a balenaCloud roadmap item with no ETA that will expose CPU serial, MACs etc as tags on devices.
However, right now we have customers using the SDK to set their own custom tags per device, so for example your code would set the Mac as a device tag on initial boot.
Hope it helps.

Thanks @alexgg the roadmap item to add the device specific details as tags sounds promising for sure. Just so I am clear about what you are in terms of the custom tags, you are proposing using the supervisor API from within a deployed app to update custom tags (or hostname etc)? Given the docker environment exposed to our App, are we going to be able to recover the real mac address of the device. Maybe the serial number might be accessible but I expect the inside a container view of the network adaptor is different to the host OS.

Hi
You should be able to access all network device information normally if the container is run with network_mode: host.