Azure / iot-edge-v1

Azure IoT Edge
http://azure.github.io/iot-edge/
Other
524 stars 258 forks source link

iotedgectl setup failed in Azure VM #599

Closed shasdas closed 6 years ago

shasdas commented 6 years ago

iotedgectl setup failed

I'm trying to setup iotedgectl following https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-simulate-device-windows in my Azure VM (VM spec is given below)

image

Python and iotedgectl versions, running on the VM, are given below

image

Script I executed is similar to below iotedgectl setup --connection-string "<conn string>" --nopass --edge-hostname <a shorter hostname>

Error I'm getting is given below

INFO: Using default IoT Edge configuration dir: C:\ProgramData\azure-iot-edge\config Traceback (most recent call last): File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "c:\python27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "c:\Python27\Scripts\iotedgectl.exe\__main__.py", line 9, in <module> File "c:\python27\lib\site-packages\edgectl\__init__.py", line 25, in coremain return cli.execute_user_command() File "c:\python27\lib\site-packages\edgectl\cli\edgecli.py", line 69, in execute_user_command if self._process_cli_args(): File "c:\python27\lib\site-packages\edgectl\cli\edgecli.py", line 371, in _process_cli_args return args.func(args) File "c:\python27\lib\site-packages\edgectl\cli\edgecli.py", line 389, in _parse_edge_command return parse_funcs[args.subparser_name](args) File "c:\python27\lib\site-packages\edgectl\cli\edgecli.py", line 498, in _parse_setup_options is_valid = self._parse_and_validate_user_input(args) File "c:\python27\lib\site-packages\edgectl\cli\edgecli.py", line 435, in _parse_and_validate_user_input self.edge_config = parser.parse() File "c:\python27\lib\site-packages\edgectl\parser\edgeconfigparsercli.py", line 96, in parse uri = EdgeHostPlatform.get_docker_uri() File "c:\python27\lib\site-packages\edgectl\host\edgehostplatform.py", line 20, in get_docker_uri engine_os = dc.get_os_type() File "c:\python27\lib\site-packages\edgectl\host\dockerclient.py", line 99, in get_os_type info = self._client.info() File "c:\python27\lib\site-packages\docker\client.py", line 174, in info return self.api.info(*args, **kwargs) File "c:\python27\lib\site-packages\docker\api\daemon.py", line 88, in info return self._result(self._get(self._url("/info")), True) File "c:\python27\lib\site-packages\docker\utils\decorators.py", line 46, in inner return f(self, *args, **kwargs) File "c:\python27\lib\site-packages\docker\api\client.py", line 192, in _get return self.get(url, **self._set_request_timeout(kwargs)) File "c:\python27\lib\site-packages\requests\sessions.py", line 521, in get return self.request('GET', url, **kwargs) File "c:\python27\lib\site-packages\requests\sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "c:\python27\lib\site-packages\requests\sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "c:\python27\lib\site-packages\requests\adapters.py", line 440, in send timeout=timeout File "c:\python27\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen chunked=chunked) File "c:\python27\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request conn.request(method, url, **httplib_request_kw) File "c:\python27\lib\httplib.py", line 1042, in request self._send_request(method, url, body, headers) File "c:\python27\lib\httplib.py", line 1082, in _send_request self.endheaders(body) File "c:\python27\lib\httplib.py", line 1038, in endheaders self._send_output(message_body) File "c:\python27\lib\httplib.py", line 882, in _send_output self.send(msg) File "c:\python27\lib\httplib.py", line 844, in send self.connect() File "c:\python27\lib\site-packages\docker\transport\npipeconn.py", line 31, in connect sock.connect(self.npipe_path) File "c:\python27\lib\site-packages\docker\transport\npipesocket.py", line 22, in wrapped return f(self, *args, **kwargs) File "c:\python27\lib\site-packages\docker\transport\npipesocket.py", line 50, in connect win32pipe.WaitNamedPipe(address, self._timeout) pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')

aribeironovaes commented 6 years ago

Hi @shasdas ,

Can you check your docker installation? From the logs it looks like it was not able to connect to docker (timed out).

BTW, next release we have already better logs to point our problems with docker.

Try it out and let us know,

Thanks,

Angelo Ribeiro.

shasdas commented 6 years ago

Thanks @aribeironovaes for your input. Yes, issue is related to docker installation and in my Azure VM (spec is given above in a screen shot) I could see MobiLinuxVM failed to start as shown below. This VM spec I chose because I use this as dev box. I'm doing a PoC on IoT edge at the moment and using same VM for that purpose. Do I need to create a VM of different spec or this should be sufficient? Your input would be a great help.

image

aribeironovaes commented 6 years ago

Hi @shasdas ,

So, please, check this github issue here: https://github.com/docker/for-win/issues/574 and follow the instructions to check if Docker starts on your machine.

Although I haven't tried to run docker on an Azure Virtual Machine I don't believe it would be a problem.
I also found this Stack Overflow discussion that seems similar with the problem you are having. Somebody told that it is not possible to enable nested virtualization, but last answer says it's possible. So, you may try... https://stackoverflow.com/questions/44817161/installing-docker-on-azure-virtual-machine-windows-10

If you keep having problem with that I would switch to a real machine (if you can), or open a ticker on Azure VM to check if they have a better solution.

Let us know how it goes.

Thanks,

Angelo Ribeiro.

shasdas commented 6 years ago

Hi @aribeironovaes ,

I tried the option mentioned in stackoverflow, that did not work for me. Thanks for linking this issue with docker/for-win#574 . Have gone through this, seems Windows 10 Azure VM might not work to run docker, Windows 2016 Server Azure VM should be good for this. Let's see if someone responds on this. Thank You!

shasdas commented 6 years ago

Hi @aribeironovaes ,

Today I found that in Windows 10 Enterprise (Azure VM) can also be fine if Standard D4s v3 (4 vcpus, 16 GB memory) VM is chosen, this supports nested virtualization thus running docker should be fine. Finally iotedgectl setup should work as expected.

Previously I was using a Standard DS2 v2 (2 vcpus, 7 GB memory) VM. Today I created a Standard D4s v3 (4 vcpus, 16 GB memory) VM and able to run iotedgectl setup on it.

aribeironovaes commented 6 years ago

Cool! Thanks for the update!

Sent from my phone

On May 10, 2018, at 11:19 AM, Shaswata Das notifications@github.com wrote:

Hi @aribeironovaes ,

Today I found that in Windows 10 Enterprise (Azure VM) can also be fine if Standard D4s v3 (4 vcpus, 16 GB memory) VM is chosen, this supports nested virtualization thus running docker should be fine. Finally iotedgectl setup should work as expected.

Previously I was using a Standard DS2 v2 (2 vcpus, 7 GB memory) VM. Today I created a Standard D4s v3 (4 vcpus, 16 GB memory) VM and able to run iotedgectl setup on it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.