Azure容器实例处于“正在创建”状态

时间:2017-12-06 19:46:24

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

我是否有Jenkins的azure代理插件制作我的容器,或者如果我手动操作,它似乎从未进入任何运行状态。

enter image description here

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正在试图解决这个问题,我无法改变我做任何事情的顺序。这只是一个命令。

3 个答案:

答案 0 :(得分:1)

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

从上面的文章中检查部署日志: 启用调试日志记录 电源外壳 在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

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

以上链接包含更多详细信息。如果这有帮助,请告诉我。

答案 1 :(得分:1)

想出来,结果是我的可执行路径中的命令中的反斜杠并没有让他们的逃脱受到尊重。要么是因为我从bash调用@receiver(pre_delete, dispatch_uid='User') def user_del(sender, instance, **kwargs): i = instance events = VacationEvent.objects.filter(user_id=166) schedule = prefetch_related_objects(events, 'schedule_file__user') schedule.delete() # instance.user.schedulefile_set.clear() # qs = VacationEvent.objects.filter(user_id=166).prefetch_related_('schedule_file') # qs.delete() # b = ScheduleFile.objects.filter(user_id=166) # e = VacationEvent.objects.filter(user_id=166) # e.schedule_file.remove(b) ,要么是因为Azure方面没有正确处理转义,或者没有自己转义它们。

我的解决方案是在路径中使用正斜杠。 Windows似乎正在正确地处理它们,我宁愿不要对其反斜杠的奇怪偏好感到困扰。

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

答案 2 :(得分:0)

你的形象有多大?您总是可以通过两个步骤进行调试。

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

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

相关问题