【问题标题】:Azure functions on Premises - Error response from daemon: Cannot kill container本地 Azure 功能 - 来自守护程序的错误响应:无法终止容器
【发布时间】:2018-08-23 10:13:18
【问题描述】:

我正在使用 Azure Functions on Premises V2(运行时)。

尝试测试一个每分钟执行一次并写入日志的简单函数。

但是函数没有执行,我得到了这个错误。

它在装有 Windows server 2016 的虚拟机上运行。 (我认为可能是导致此问题的原因)。

我是 Docker 和 Hyper-V 的新手,我们将不胜感激。

有一些命令可以让我执行,如果 Hyper V 和 Docker 运行良好?

提前致谢。

这是我得到的日志。

2018 年 3 月 14 日下午 5:42:44 欢迎,您现在已连接到日志流服务。2018 年 3 月 14 日下午 5:41:48 [myteslaVM] 功能应用程序“MyContainerFuncApp”正在启动... 3/14/2018 5:41:49 PM [myteslaVM] 拉取容器映像 azfuncrun/azure-functions-runtime:preview2-latest-nanoserver3/14/2018 5:41:50 PM [myteslaVM] preview2-latest-nanoserver: Pulling来自 azfuncrun/azure-functions-runtime3/14/2018 5:41:50 PM [myteslaVM] 摘要:sha256:dfdb47a7638d0cdd1a42c603e3e59311ee0d229222f88329a7c561fc3d8b2ff33/14/2018VM 5:41:50 PM [mytesazfuncrun/azure Image] 最新状态-functions-runtime:preview2-latest-nanoserver

3/14/2018 5:41:50 PM [myteslaVM] 容器镜像 azfuncrun/azure-functions-runtime:preview2-latest-nanoserver 已成功拉取! 3/14/2018 5:41:50 PM [myteslaVM] 供应容器 MyContainerFuncApp_03/14/2018 5:41:51 PM [myteslaVM] f2788b6c9c5d6115bba891f463759dd0df75c2344e6c217b0280a8b9f686fb32 2018 年 3 月 14 日下午 5:41:51 [myteslaVM] C:\Program Files\Azure Functions Runtime\docker\docker.exe:来自守护进程的错误响应:容器 f2788b6c9c5d6115bba891f463759dd0df75c2344e6c217b0280a8b9f686fb32

encountered an error during CreateContainer: failure in a Windows system call: No hypervisor is present on this system. (0xc0351000) extra info: {"SystemType":"Container","Name":"f2788b6c9c5d6115bba891f463759dd0df75c2344e6c217b0280a8b9f686fb32","Owner":"docker","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\Program Files\\Azure Functions Runtime\\docker\\windows\\windowsfilter\\f2788b6c9c5d6115bba891f463759dd0df75c2344e6c217b0280a8b9f686fb32","Layers":[{"ID":"951f96e7-ad8c-5e5c-8533-4f70d49a4e6a","Path":"C:\\Program Files\\Azure Functions

"HostName":"f2788b6c9c5d","MappedDirectories":[{"HostPath":"c:\windows\temp\fwas\mycontainerfuncapp","ContainerPath":"c:\home","ReadOnly":false ,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":false}],"HvPartition":true,"EndpointList":["d6c4c527-5520-40f1-9c84-2f3d8a013900"],"HvRuntime":{ "ImagePath":"C:\Program Files\Azure Functions Runtime\docker\windows\windowsfilter\545c1be2ad30f1933a07de48e4ffe611900bacafbf4b717de969b56fb8a725d6\UtilityVM"},"AllowUnqualifiedDNSQuery":true}。

3/14/2018 5:41:51 PM [myteslaVM] 向容器发出停止命令:MyContainerFuncApp_

    03/14/2018 5:41:52 PM [myteslaVM] Error response from daemon: Cannot kill container: MyContainerFuncApp_0: No such container: MyContainerFuncApp_03/14/2018 5:41:52 PM [myteslaVM] Stop complete for container: MyContainerFuncApp_03/14/2018 5:41:52 PM [myteslaVM] ExecuteCommand called with C:\Program Files\Azure Functions Runtime\docker\docker.exe returned 125.3/14/2018 5:42:03 PM [myteslaVM]

    Function App 'MyContainerFuncApp' is starting...3/14/2018 5:42:04 PM [myteslaVM] Pull container image azfuncrun/azure-functions-runtime:preview2-latest-nanoserver3/14/2018 5:42:06 PM [myteslaVM] preview2-latest-nanoserver: Pulling from azfuncrun/azure-functions-runtime3/14/2018 5:42:06 PM [myteslaVM] Digest: sha256:dfdb47a7638d0cdd1a42c603e3e59311ee0d229222f88329a7c561fc3d8b2ff3

    3/14/2018 5:42:06 PM [myteslaVM] Status: Image is up to date for azfuncrun/azure-functions-runtime:preview2-latest-nanoserver3/14/2018 5:42:06 PM [myteslaVM] The container image azfuncrun/azure-functions-runtime:preview2-latest-nanoserver has been pulled successfully!3/14/2018 5:42:06 PM [myteslaVM] Provisioning container MyContainerFuncApp_13/14/2018 5:42:07 PM [myteslaVM] 10dfbab15acef64780c34d5d01ded776a10d074500b33ba916b032920404d1d13/14/2018 5:42:07 PM [myteslaVM] C:\Program Files\Azure Functions Runtime\docker\docker.exe: 

【问题讨论】:

  • Hyper-V 功能是否已安装并在您的计算机上运行,​​并且 docker 服务是否正在运行?该错误消息“此系统上不存在管理程序”。提示您的虚拟化基础设施存在一些问题。
  • 我从 Server Manager Tool 开始配置 Hyper-V。在管理。添加角色和功能向导。它似乎正在运行,但是我不知道是否有一些命令可以确认配置是否正确。?事实上,在服务中,有一些服务是为 Hyper-V 运行的。 -数据交换服务 -访客服务接口 -访客关机服务 -心跳服务 -主机计算服务 -PowerShell直接服务 -远程桌面虚拟化 -时间同步服务 -虚拟机管理 -卷影复制请求。对于 Docker。我检查了服务,并且有一项服务正在运行。 -Docker 引擎。

标签: azure docker hyper-v azure-functions-runtime


【解决方案1】:

经过一些研究,我做了后续步骤以尝试解决此错误。

1.Windows Server 2016配置

https://app.pluralsight.com/player?course=installing-windows-server-2016&author=greg-shields&name=installing-windows-server-2016-m2&clip=5&mode=live

--Install Features and Roles.

2.安装Hyper-V

https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/install-the-hyper-v-role-on-windows-server

To check Hyper-V installed, run this cmd let in Power Shell.
Get-WindowsFeature -ComputerName <computer_name>  

Get-WindowsFeature -ComputerName MyteslaVM

To Install Hyper-V
Add-WindowsFeature –name RSAT-Hyper-V-Tools

    https://social.technet.microsoft.com/Forums/windows/en-US/f750d5e3-69f8-4cbd-a7aa-98e2fd41c618/need-to-install-hyperv-management-tools-on-server-2012-vm?forum=winserverhyperv

3.执行Docker版本。

4.执行 Dockerd“守护进程”。

https://www.bountysource.com/issues/40602674-can-t-start-docker-service-on-windows-server-vm
dockerd --debug

Stop-service docker
Get-ContainerNetwork | Remove-ContainerNetwork -Force
Start-service docker

5。 获取虚拟机 | Set-VMProcessor -ExposeVirtualizationExtensions $true

https://github.com/Azure/Azure-Functions/issues/359

6.安装Docker

https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-server

Install-Module -Name DockerMsftProvider -RequiredVersion 1.0.0.3
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider

7.安装最新的azure-functions-core-tools:

npm i -g azure-functions-core-tools@core

 Run npm i -g npm           **to update
  1. 安装 .NET Core 2.0

    https://www.microsoft.com/net/download/windows

9.要启用嵌套虚拟化,您需要在 Hyper-V 主机中运行以下 cmdlet:

Get-VM | Set-VMProcessor -ExposeVirtualizationExtensions $true

10.运行脚本

https://github.com/moby/moby/issues/19685

11.下载azure-functions-runtime:2.0.0-nanoserver

docker pull microsoft/azure-functions-runtime:2.0.0-nanoserver-1709

12.Hyper-V 组件之一未运行

https://social.technet.microsoft.com/Forums/en-US/b4d0761d-6048-4cb8-9a1f-1a2544b4ceb2/one-of-the-hyperv-components-is-not-running?forum=win10itprovirt

13.禁用Windows防御者。

https://www.windowscentral.com/how-permanently-disable-windows-defender-windows-10

【讨论】:

    【解决方案2】:

    似乎 Azuer Function 运行时组件不适用于 Windows Server 2016, 因为容器。

    我在新的虚拟机上进行了尝试,使用的是 Windows 10 Pro。现在它正在工作。 步骤:

    1. 使用 Windows 10 专业版创建虚拟机
    2. 安装/启用 Hyper-V
    3. 为 Azure Functions 安装和配置组件。

    see image for Azure Function Running

    【讨论】:

      【解决方案3】:

      在对该主题进行更多研究后,我意识到它不适用于基本计划 (SKU) 虚拟机。

      仅适用于标准计划中的 SKU。

      适用于 Windows Pro 和 Windows Server 2016。

      【讨论】:

        猜你喜欢
        • 2023-01-08
        • 1970-01-01
        • 2019-03-15
        • 2023-04-08
        • 1970-01-01
        • 1970-01-01
        • 2016-03-20
        • 2021-08-05
        • 2019-12-12
        相关资源
        最近更新 更多