1

When using IoT Edge without DPS, I can persist state and log data in modules that survive reboot and service restarts.

When using IoT Edge with DPS (example symmetrical key), every time the OS is restarted or the service is restarted, IoT Edge deletes (losing log and state data) the modules and recreates them. This makes troubleshooting and managing modules and business applications a challenge.

  • OS: Windows IoT 1809 (LTSC)
  • IoT Edge version: iotedge 1.0.9.3 (ad04e23b1865211913282b918263700deafdccfa)
  • IoT Edge Agent: Version - 1.0.9.4.32971639 (12d55e582cc7ce95c8abfe11eddfbbc938ed6001)

Steps to reproduce:

  1. Install Windows IoT 1809 (though I don't think this is OS specific)
  2. Install IoT Edge using a SAS token (not DPS) (https://learn.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-windows)
  3. In the Azure Portal, add a simple Module (I used: docker.io/ksaye/mqttdemo:0.0.2-windows-amd64, but any will do)
  4. When the module is deployed to the edge, run (to get in the container): docker -H npipe:////./pipe/iotedge_moby_engine exec -i -t %yourmodulename% cmd
  5. Inside the module container, run: echo hello > test.txt
  6. Inside the module container, run: type test.txt to see your content
  7. Type exit to exit the module container and then reboot your system
  8. After the device starts, again run (to get in the container): docker -H npipe:////./pipe/iotedge_moby_engine exec -i -t %yourmodulename% cmd
  9. Again in the module container run: type test.txt to see that your content has persisted the reboot

(now to see the undesired behavior)

  1. Stop the iotedge service run: net stop iotedge
  2. Change the c:\programdata\iotedge\config.yaml to use DPS with a symmetrical key
  3. Re run steps 4 - 9, but this time step 9 will fail because the file will not be there

Is there a setting or configuration object that can change this behavior? When deploying SQL Edge or MySQL, I can not have the containers deleted every time the device is rebooted.

Kevin Saye
  • 299
  • 1
  • 8

2 Answers2

0

This is by design, Step 11 is considered a "re-configuration" event and all modules instances are removed as part of the flow. You can see the logs of this in the edge daemon.

Venkat Yalla
  • 558
  • 2
  • 9
0

This is being tracked as an issue / bug, see: https://github.com/Azure/iotedge/issues/3283

Kevin Saye
  • 299
  • 1
  • 8