【问题标题】:Azure Container Instances stuck in "Creating" stateAzure 容器实例卡在“正在创建”状态
【发布时间】:2017-12-06 19:46:23
【问题描述】:

无论我是让 Jenkins 的 azure 代理插件制作我的容器,还是我手动完成,它似乎都永远不会进入运行状态。

az container create \
    --os-type Windows \
    --location eastus \
    --registry-login-server SERVER.azurecr.io \
    --registry-password PASSWORD \
    --registry-username USERNAME \
    --image namespace/image \
    --name jenkins-permanent \
    --resource-group devops-aci \
    --cpu 2 \
    --memory 3.5 \
    --restart-policy Always \
    --command-line "-jnlpUrl http://host:8080/computer/NAME/slave-agent.jnlp -secret SECRET -workDir \"C:\\jenkins\""

我已完成所有适用的故障排除步骤,尝试了不同的区域,但无济于事。

这是我得到的一个当前事件,这似乎是我迄今为止取得的最大进展:

          {
            "count": 1,
            "firstTimestamp": "2017-12-07T03:02:56+00:00",
            "lastTimestamp": "2017-12-07T03:02:56+00:00",
            "message": "Failed to pull image \"MYREPO.azurecr.io/my-company/windows-agent:latest\": Error response from da
emon: {\"message\":\"Get https://MYREPO.azurecr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout
exceeded while awaiting headers)\"}",
            "name": "Failed",
            "type": "Warning"
          }

有趣的是,这个事件发生在一个实例工作之后(但不幸的是我的入口点命令是错误的,所以它永远不会启动)。

我真的觉得 Azure 是在强调这一点,我只是无法改变我做任何事情的顺序。这只是一个命令。

【问题讨论】:

    标签: azure-container-service azure-container-instances


    【解决方案1】:

    亚历山大,这里有一条线索可以实际检查可能导致延迟的原因,或者如果部署在后台失败,此信息对于缩小问题范围至关重要:https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-troubleshoot-tips#determine-error-code

    从上面的文章中检查部署日志: 启用调试日志记录: 电源外壳 在 PowerShell 中,将 DeploymentDebugLogLevel 参数设置为 All、ResponseContent 或 RequestContent。

    New-AzureRmResourceGroupDeployment -ResourceGroupName examplegroup -TemplateFile c:\Azure\Templates\storage.json -DeploymentDebugLogLevel All
    

    Azure CLI

    az group deployment operation list --resource-group ExampleGroup --name vmlinux
    

    同时检查检查部署顺序: 当资源以意想不到的顺序部署时,会发生许多部署错误。当依赖项设置不正确时,会出现这些错误。当您缺少所需的依赖项时,一个资源会尝试使用另一个资源的值,但另一个资源尚不存在。

    以上链接包含更多详细信息。让我知道这是否有帮助。

    【讨论】:

    【解决方案2】:

    想通了,结果是我的可执行路径中命令中的反斜杠没有兑现它们的转义。要么是因为我从 bash 调用 az,要么是因为 Azure 端没有正确处理转义,或者没有自己转义。

    我的解决方案是在路径中使用正斜杠。 Windows 似乎正确地处理了它们,而且我不想被它对反斜杠的奇怪偏好所困扰。

    与我的问题有关的是,服务的速度使故障排除变得非常困难。进行任何修复都需要很长时间。因此,如果您正在使用 Azure 容器实例并希望获得更好的性能,请投票 this feedback item that I've created

    【讨论】:

      【解决方案3】:

      你的图片有多大?您始终可以通过 2 个步骤进行调试。

      运行az container show -g devops-aci -n jenkins-permanent。它应该包含容器 json 对象中的容器事件列表。事件消息应该会提示您正在发生的事情。

      运行az container logs -g devops-aci -n jenkins-permanent。它应该为您提供容器的日志。如果您的图像有问题,您应该能够看到一些错误输出。

      【讨论】:

      • 这是一个 Windows 映像,可能相当大。我一直在使用这两个命令来获取信息,但这些命令都不能帮助我理解我的下一步应该是什么。用另一个事件更新描述。
      猜你喜欢
      • 1970-01-01
      • 2015-04-15
      • 1970-01-01
      • 1970-01-01
      • 2020-05-19
      • 2019-03-15
      • 2016-10-24
      • 2020-08-23
      • 2021-09-23
      相关资源
      最近更新 更多