title: When using DPS, why does IoT Edge recreate containers at reboot?
body: <p>When using IoT Edge without DPS, I can persist state and log data in modules that survive reboot and service restarts.</p>
  <p>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.</p>
  <ul>
  <li>OS:                Windows IoT 1809 (LTSC)</li>
  <li>IoT Edge version:  iotedge 1.0.9.3 (ad04e23b1865211913282b918263700deafdccfa)</li>
  <li>IoT Edge Agent:  Version - 1.0.9.4.32971639 (12d55e582cc7ce95c8abfe11eddfbbc938ed6001)</li>
  </ul>
  <p>Steps to reproduce:</p>
  <ol>
  <li>Install Windows IoT 1809 (though I don't think this is OS specific)</li>
  <li>Install IoT Edge using a SAS token (not DPS) (<a href="https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-windows" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-windows</a>)</li>
  <li>In the Azure Portal, add a simple Module (I used: docker.io/ksaye/mqttdemo:0.0.2-windows-amd64, but any will do)</li>
  <li>When the module is deployed to the edge, run (to get in the container): <strong>docker -H npipe:////./pipe/iotedge_moby_engine exec -i -t %yourmodulename% cmd</strong></li>
  <li>Inside the module container, run: <strong>echo hello &gt; test.txt</strong></li>
  <li>Inside the module container, run: <strong>type test.txt</strong> to see your content</li>
  <li>Type exit to exit the module container and then reboot your system</li>
  <li>After the device starts, again run (to get in the container): <strong>docker -H npipe:////./pipe/iotedge_moby_engine exec -i -t %yourmodulename% cmd</strong></li>
  <li>Again in the module container run: <strong>type test.txt</strong> to see that your content has persisted the reboot</li>
  </ol>
  <p><em>(now to see the undesired behavior)</em></p>
  <ol start="10">
  <li>Stop the iotedge service run: <strong>net stop iotedge</strong></li>
  <li>Change the c:\programdata\iotedge\config.yaml to use DPS with a symmetrical key</li>
  <li>Re run steps 4 - 9, but this time step 9 will fail because the file will not be there</li>
  </ol>
  <p>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.</p>