Download image pre-configured with an existing device's ID

Hi there!

I think it could be very handy, if in Balena Cloud, on a device page (especially on an offline device), one could download an image pre-configured for the same UUID/device ID, so that the local CLI steps don’t need to be done.

Recently I was trying to bring back online a device that had its SD card wiped. I didn’t want to register a new device, because the existing one had already been whitelisted in some other tools, and would have made it easier to just bring it up again.

First I was trying to follow the Create/Use Pre-existing Offline Device steps from the wiki - however the steps were somewhat confusing (especially around Configure balenaOS Image), as well as I am on ArchLinux, where the balena-cli can’t seem to be installed (the package is asking for waaaaay to old nodejs installation that cannot be satisfied), so I ended up trying to hack the config.json from memory of how that might work - but it never brought up the existing device, rather I had new devices created on boot.

Since from the cloud web interface once can download various pre-configured versions, this doesn’t seem like a stretch.

Of course this can be a foot-gun (people acidentally boot up the “same device” in two different hardware, etc..) but with appropriate warnings that should be manageable? :thinking:

Hey Greg! We miss you over here at Balena! Thats a great suggestion and something I have wanted to build for a while. I’m not 100% sure we can prioritise it right now but we will keep you up to date.
The CLI flow for doing this is really not great, maybe there is low hanging fruit we could find to make it slightly easier?

PS> We should catch up on a call sometime :slight_smile:

Hey @shaunmulligan1 , long time no chat indeed!

No worries, this is understandably not very common, just thought you might find it useful to know people are out there for these sorts of things!

It’s possible to do this with the CLI, and other collaborators made it work. However on my ArchLinux I cannot even install the CLI, because it seems to ask for long outdated, Node.js 14 version :sweat_smile: ,

For the CLI side to make things easier, it’s interesting that in the docs so many values are needed to be filled - for example OS version? Which has non-obbvious format, I think, but maybe I just haven’t read things correctly. It feels as most of the values could be extracted from the image and used, rather than having to enter. But yeah, niche workflows will have less threaded paths!

Cheers!

Hi @imrehg , regarding your issue with installing our CLI on ArchLinux, are you trying to install via AUR packages? If so, I’m pretty sure those are outdated and you’ll have more luck just grabbing a .tar.gz etc release and calling its balena/bin/balena directly (I add balena/bin to my path to keep things simple). Latest release: Release v22.4.16 · balena-io/balena-cli · GitHub

Hey @joshbwlng I know we are trailing off here…. :grimacing: yeah, I’m using AUR, and it’s fair, but I prefer to use packages for cleanliness. That precompiled version is already packaged as expected as balena-cli-bin (also outdated :sweat_smile: ), missed that last time, and would make a no-fuss install easier (even if one has to keep their own packages up-to-date). Gonna take another look.
And I see that the balena-cli is not just out of date but an orphan, so that puts things into more context.

Hey @imrehg I just wanted to let you know that I’m now maintaining the balena-cli-bin AUR package, and have updated it to the latest release of balena-cli. Hopefully that helps you out a bit.