You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not really a bug or anything but comments on the configuration system.
On embedded devices you have things that are different: host names, and device IDs.
Now, the hostname is in the OS through utilities or a file. You can run "hostname" and get the hostname, and strip the \n to get the string.
The serial number is usually embedded in EEPROM or on disk.
The Scope ID is fine, since it's static across the fleet.
The problem is that you can't expect people to log into each device and do config apply every single time, so therefore you must create a bunch of scripts producing the final result with replaced hostname and serial number.
The second problem is that embedded devices have images with read-only file systems. So you can't just apply the configuration.
Then you need to direct the configuration to a writable partition.
Seriously engineered embedded devices have predictable OS images and are not modifiable.
So how I solved this was to look at how the files looked like after applying config, scattered across the different services.
Then I needed to replace hostname + serial number in the appropiate places.
(By the way, you have hostname in both aziot-edged and aziot-identityd by the way. Shouldn't there only be one place this is?)
Next, my template config files are "patched" and put on a writable location.
But iot edge has to know where these files are, so I had to dig in the source code to see if there were any env vars that could change it, and luckily they were. So I had to modify the systemd service as well with vars like AZIOT_EDGED_CONFIG_DIR.
Now, this works, but iotedge check does not pick up these locations. So at the very least (I now it's a bit late to change the configuration system now) it should ask the main service what those locations are to do the check correctly. I know they are correct since it works but I assume the check just checks the default paths. I know you can use overlayfs and point the conf.d directories to the writable partition. But it's still a hack.
My main point is that dynamic things like registration ID and host name should have an option to be automatically be resolved, or extend the configuration to accept a reference to a bash script to resolve them. That way the configuration files can be static in one place.
Just a suggestion!
The text was updated successfully, but these errors were encountered:
Thanks @emilm for the feedback. We are tracking the feature requests in this forum rather than in the GitHub. Can you please create a new post in this forum for feature requests for IoT Edge?
This is not really a bug or anything but comments on the configuration system.
On embedded devices you have things that are different: host names, and device IDs.
Now, the hostname is in the OS through utilities or a file. You can run "hostname" and get the hostname, and strip the \n to get the string.
The serial number is usually embedded in EEPROM or on disk.
The Scope ID is fine, since it's static across the fleet.
The problem is that you can't expect people to log into each device and do config apply every single time, so therefore you must create a bunch of scripts producing the final result with replaced hostname and serial number.
The second problem is that embedded devices have images with read-only file systems. So you can't just apply the configuration.
Then you need to direct the configuration to a writable partition.
Seriously engineered embedded devices have predictable OS images and are not modifiable.
So how I solved this was to look at how the files looked like after applying config, scattered across the different services.
Then I needed to replace hostname + serial number in the appropiate places.
(By the way, you have hostname in both aziot-edged and aziot-identityd by the way. Shouldn't there only be one place this is?)
Next, my template config files are "patched" and put on a writable location.
But iot edge has to know where these files are, so I had to dig in the source code to see if there were any env vars that could change it, and luckily they were. So I had to modify the systemd service as well with vars like AZIOT_EDGED_CONFIG_DIR.
Now, this works, but iotedge check does not pick up these locations. So at the very least (I now it's a bit late to change the configuration system now) it should ask the main service what those locations are to do the check correctly. I know they are correct since it works but I assume the check just checks the default paths. I know you can use overlayfs and point the conf.d directories to the writable partition. But it's still a hack.
My main point is that dynamic things like registration ID and host name should have an option to be automatically be resolved, or extend the configuration to accept a reference to a bash script to resolve them. That way the configuration files can be static in one place.
Just a suggestion!
The text was updated successfully, but these errors were encountered: