MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.28k stars 21.45k forks source link

This doesn't work on Azure VM #44081

Closed maxbog closed 4 years ago

maxbog commented 4 years ago

I tried to folow this guide by installing the simulator and IoT Edge runtime on Azure VM, but it does not work. The guide talks about using TPM simulator for attestation, but when the iotedged.exe wants to provision the device, italways looks for a physical TPM device.

Is there something I need to do so that the IOT Edge runtime switches to using TPM simulator instead of trying to find a physical one?

I ran the iotedged in a console window and this is the output:

PS C:\tpmsimulator> $env:IOTEDGE_RUN_AS_CONSOLE = "true"
PS C:\tpmsimulator> & 'C:\Program Files\iotedge\iotedged.exe' -c C:\ProgramData\iotedge\config.yaml
<6>2019-12-04T20:53:00Z [INFO] - Starting Azure IoT Edge Security Daemon
<6>2019-12-04T20:53:00Z [INFO] - Version - 1.0.8 (208b2204fd30e856d00b280112422130c104b9f0)
<6>2019-12-04T20:53:00Z [INFO] - Using runtime network id nat
<6>2019-12-04T20:53:00Z [INFO] - Initializing the module runtime...
<6>2019-12-04T20:53:00Z [INFO] - Initializing module runtime...
<6>2019-12-04T20:53:00Z [INFO] - Successfully initialized module runtime
<6>2019-12-04T20:53:00Z [INFO] - Finished initializing the module runtime.
<6>2019-12-04T20:53:00Z [INFO] - Configuring C:\ProgramData\iotedge as the home directory.
<6>2019-12-04T20:53:00Z [INFO] - Configuring certificates...
<6>2019-12-04T20:53:00Z [INFO] - Transparent gateway certificates not found, operating in quick start mode...
<6>2019-12-04T20:53:00Z [INFO] - Finished configuring certificates.
<6>2019-12-04T20:53:00Z [INFO] - Initializing hsm...
<6>2019-12-04T20:53:00Z [INFO] - Finished initializing hsm.
<6>2019-12-04T20:53:00Z [INFO] - Detecting if configuration file has changed...
<6>2019-12-04T20:53:00Z [INFO] - No change to configuration file detected.
<6>2019-12-04T20:53:00Z [INFO] - Edge issuer CA expiration date: 2020-03-03T13:39:43Z
<6>2019-12-04T20:53:00Z [INFO] - Obtaining workload CA succeeded.
<6>2019-12-04T20:53:00Z [INFO] - Provisioning edge device...
<6>2019-12-04T20:53:00Z [INFO] - Starting provisioning edge device via TPM...
Error: Time:Wed Dec  4 20:53:00 2019 File:D:\a\1\s\edgelet\hsm-sys\azure-iot-hsm-c\deps\utpm\src\tpm_comm_win32.c Func:tpm_comm_create Line:99 Failure: Tbsi_Context_Create A compatible Trusted Platform Module (TPM) Security Device cannot be found on this computer..
Error: Time:Wed Dec  4 20:53:00 2019 File:D:\a\1\s\edgelet\hsm-sys\azure-iot-hsm-c\deps\utpm\src\tpm_codec.c Func:Initialize_TPM_Codec Line:258 creating tpm_comm object
<3>2019-12-04T20:53:00Z [ERR!] (D:\a\1\s\edgelet\hsm-sys\azure-iot-hsm-c\src\hsm_client_tpm_device.c:initialize_tpm_device:273) Failure initializeing TPM Codec
<3>2019-12-04T20:53:00Z [ERR!] (D:\a\1\s\edgelet\hsm-sys\azure-iot-hsm-c\src\hsm_client_tpm_device.c:hsm_client_tpm_create:306) Failure initializing tpm device.
<3>2019-12-04T20:53:00Z [ERR!] - The daemon could not start up successfully: Could not initialize DPS provisioning client
<3>2019-12-04T20:53:00Z [ERR!] -        caused by: HSM API returned an invalid null response

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Alberto-Vega commented 4 years ago

@maxbog Thanks for the feedback! It looks like you were following this doc for Simulated device and individual enrollment guides? https://docs.microsoft.com/en-us/azure/iot-dps/quick-create-simulated-device

Alberto-Vega commented 4 years ago

@maxbog Have you seen this issue on the Azure IoT Edge repo? https://github.com/Azure/iotedge/issues/1106

Alberto-Vega commented 4 years ago

@maxbog Not sure if you were able to resolve the issue or not. Closing this since we haven't heard back.

If there are further questions regarding this matter or if you still need help, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.