MicrosoftDocs / azure-docs

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

ADU on downstream Raspberry Pi device in Nested Edge #81290

Closed jeevannagvekar closed 2 years ago

jeevannagvekar commented 2 years ago

Hello, I have configured nested edge hierarchy like this.

Top Layer (IoT Edge Runtime with IoTEdgeAPIProxy and registry modules) --> Lower layer (IoT Edge Runtime with IoTEdgeAPIProxy module) --> RPI (downstream IoT device with sample image provided @ https://github.com/Azure/iot-hub-device-update/releases - latest release 0.7.0 (2021-05-14)).

Now I am trying to deploy an update to downstream device. This device is able to connect to IoT Hub and visible from there.

But update image download is failing. I am attaching the log of delivery optimization agent for reference deliveryOptAgent.txt.

While going through documentation, found that Microsoft Connected Cache Module is required to be deployed on parent (Lower Layer) and its parent (top Layer) IoT Edge device. https://docs.microsoft.com/en-us/azure/iot-hub-device-update/connected-cache-nested-level.

Please confirm my understanding. If not let me know what could be the cause of the error?


Document Details

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

SatishBoddu-MSFT commented 2 years ago

Hello @jeevannagvekar Thanks for the feedback! We are currently investigating and will update you shortly.

SatishBoddu-MSFT commented 2 years ago

Hello @jeevannagvekar

The document has already stated that the Microsoft Connected Cache module has to be added to the Parent & Child gateway configurations. Please let us know if you need further help in this matter.

image

image

jeevannagvekar commented 2 years ago

Hi @SatishBoddu-MSFT Thanks for the confirmation. I am trying to set MCC module on Topmost Parent and Child edge device.

Here are some more questions:

  1. I have requested access to the preview as per https://aka.ms/MCCForDeviceUpdateForIoT. How much days it will take to get the access? Will the CUSTOMER_ID, CUSTOMER_KEY be mailed to me?

  2. What is the MCC Image URI? Is this correct? mcr.microsoft.com/mcc/linux/iot/mcc-ubuntu-iot-amd64:latest . Or is it $upstream:8000/mcc/linux/iot/mcc-ubuntu-iot-amd64:latest

  3. Parent and child edge devices are Raspberry Pi Devices with Raspbian Buster OS. Will this MCC image be compatible?

SatishBoddu-MSFT commented 2 years ago

Hello @AndyRiv could you please suggest in this matter if you have any information on the above questions?

jeevannagvekar commented 2 years ago

Hi @andyrivMSFT, could you get a chance to look into this?

andyrivMSFT commented 2 years ago

Hello @jeevannagvekar I see your request this week for program access to the Connected Cache preview. I'll get to this today and send you information via the email you provided. Thanks!

jeevannagvekar commented 2 years ago

Hi @andyrivMSFT, thanks for the information.

I have more questions after unsuccessful attempt to update image via connected cache.

  1. I was able to successfully deploy MCC module edge gateway. But leaf device (raspberry pi) is not able to download the update image. “DO client is configured to download from an MCC on IoT Edge Gateway Child rather than CDN”. Is there any configuration at leaf device? I think just GatewayHostName in connection string is sufficient.

Here are the logs: ADU Log: aduc.20211018-143034.log

DO Log: do-agent.20211018_105214.log

a. I have single level MCC. b. I have not deployed API proxy and Registry modules. These are required if more than 1 level is nesting. c. Edge gateway is directly connected to Internet over wifi. d. Using sample image provided by Microsoft e. At Leaf device, verified “wget http:///mscomtest/wuidt.gif?cacheHostOrigin=au.download.windowsupdate.com”. Able to download the sample gif. f. I find the *. nlu.dl.adu.microsoft.com in default list of cache node. So I have not added any new cache node via ENV variable.

Need more support to debug this issue.

  1. What’s the procedure to generate the credentials (Cache node ID, customer key etc)? I believe it would be published in Public review. These credentials are to protect access to the CDN sites/data.

  2. I see that there is a list of default cache node IDs. Even after we generate above credentials for our own CDN, still these default node ids be available/accessible?

Thanks, Jeevan

andyrivMSFT commented 2 years ago

Hello @jeevannagvekar,

Looking at the DO logs there is no Connected Cache that has been set on the device:

2021-10-18T14:30:46.4559231Z 441 442 trace {NextHost} Returning MCC host: []

Is the your downstream IoT leaf device internet disconnected? Did you Provision connection the string for ADU? https://docs.microsoft.com/en-us/azure/iot-hub-device-update/device-update-raspberry-pi#provision-connection-string-on-sd-card

The connection string within ADU is used to configure the Delivery Optimization client for MCC.

What’s the procedure to generate the credentials (Cache node ID, customer key etc)? I believe it would be published in Public review. These credentials are to protect access to the CDN sites/data. For the private-preview timeframe the necessary CustomerID, CacheNodeID, and CustomerKey are generated by us for you.

I see that there is a list of default cache node IDs. Even after we generate above credentials for our own CDN, still these default node ids be available/accessible? I don't understand what you are saying here. What is the list of default cache node IDs? The CacheNodeIDs uniquely identify that node to Microsoft so that we can verify entitled MCC and so that we can upload telemetry for customer and Microsoft use.

Thanks

jeevannagvekar commented 2 years ago

Hi @andyrivMSFT,

Thanks for the answers.

My downstream IoT leaf device has no direct internet connection. It connects via Edge Gateway. Below is the connection string to provision the device. The leaf device shows "connectionState": "Connected" in its device twin.

R-Pi (192.168.137.2 - Eth) --> Azure IoT Edge Gateway (192.168.137.3 - Eth, 192.168.1.16 - wifi) --> Wifi Internet Connection

_connection_string=HostName=XXXX.azure-devices.net;DeviceId=aduchildrpi;SharedAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;GatewayHostName=192.168.137.3 edgegateway_cert_path=/adu/192.168.1.16.root.cert.pem aduc_manufacturer=COEADUTeam aducmodel=COERefDevice

Logs are generated after deployment is started from Azure portal - ADU service.

At Leaf device, verified “wget http://192.168.137.3/mscomtest/wuidt.gif?cacheHostOrigin=au.download.windowsupdate.com”. Able to download the sample gif.

I am using image adu-update-image-raspberrypi3-0.7.5199.1.swu - version 0.7.0 (2021-05-14) at https://github.com/Azure/iot-hub-device-update/releases

Thanks

andyrivMSFT commented 2 years ago

Hello @jeevannagvekar,

Adding @jimson-msft here to provide more help from the DO side.

To confirm, what you are saying is that the logs you provided earlier, you have configured the connection string in the adu configuration file?

Thanks

jeevannagvekar commented 2 years ago

Yes. Connection string is configured first in ADU configuration file before attempting Deployment from ADU service.

From some time back, I am getting this error. MCC Module has stopped loading. Are the private preview credentials expired?

_Oct 19 12:50:09 jeevan-VirtualBox aziot-keyd[7162]: 2021-10-19T07:20:09Z [INFO] - --> 200 {"content-type": "application/json"} Oct 19 12:50:09 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:09Z [INFO] - [mgmt] - - - [2021-10-19 07:20:09.427871888 UTC] "GET /modules?api-version=2020-07-07 HTTP/1.1" 200 OK 1286 "-" "iotedge/0.1.0" auth_id(-) Oct 19 12:50:10 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:10Z [INFO] - Checking edge runtime status Oct 19 12:50:10 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:10Z [INFO] - Edge runtime is running. Oct 19 12:50:15 jeevan-VirtualBox aziot-identityd[7159]: 2021-10-19T07:20:15Z [INFO] - --> 200 {"content-type": "application/json"} Oct 19 12:50:15 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:15Z [INFO] - [mgmt] - - - [2021-10-19 07:20:15.182298576 UTC] "PUT /identities/ConnectedCache?api-version=2020-07-07 HTTP/1.1" 200 OK 104 "-" "-" auth_id(-) Oct 19 12:50:15 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:15Z [INFO] - Pulling image via tag msconnectedcachedev.azurecr.io/device-update-for-iothub/microsoft-connected-cache:latest... Oct 19 12:50:50 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:50Z [WARN] - Could not pull image msconnectedcachedev.azurecr.io/device-update-for-iothub/microsoft-connected-cache:latest Oct 19 12:50:50 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:50Z [WARN] - caused by: Get "https://msconnectedcachedev.azurecr.io/v2/": dial tcp: lookup msconnectedcachedev.azurecr.io: no such host Oct 19 12:50:50 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:50Z [INFO] - [mgmt] - - - [2021-10-19 07:20:50.528140036 UTC] "POST /modules?api-version=2020-07-07 HTTP/1.1" 500 Internal Server Error 304 "-" "-" auth_id(-) Oct 19 12:50:50 jeevan-VirtualBox aziot-edged[7151]: 2021-10-19T07:20:50Z [INFO] - Pulling image via tag msconnectedcachedev.azurecr.io/device-update-for-iothub/microsoft-connected-cache:latest...

Thanks

andyrivMSFT commented 2 years ago

@jeevannagvekar please check your email. We have updated the password for the ACR hosting the private preview of MCC. Please update your IoT Edge credentials with the new username and password provided.

Thanks

jeevannagvekar commented 2 years ago

@andyrivMSFT, Thanks for sharing the credentials. I was able to complete the Device Update. The image download, installation and status update in ADU service was complete. It was a permission issue (https://github.com/Azure/iot-hub-device-update/issues/38#issuecomment-826004660) .

Thanks

andyrivMSFT commented 2 years ago

please-close