Azure 容器部署 - “操作失败,状态为 200:资源状态失败" [英] Azure Containers deployment - "Operation failed with status 200: Resource State Failed"

查看:21
本文介绍了Azure 容器部署 - “操作失败,状态为 200:资源状态失败"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Azure 中,我们尝试使用带有准备好的 YAML 的 Azure 容器实例来创建容器.在我们执行 az container create 命令的机器上,我们可以在输入密码后成功登录到我们的私有注册表(例如 JFrog Artifactory 上的 fa-docker-snapshot-local.docker.comp.dev ),我们可以码头工人也拉它

From Azure we try to create container using the Azure Container Instances with prepared YAML. From the machine where we execute az container create command we can login successfully to our private registry (e.g fa-docker-snapshot-local.docker.comp.dev on JFrog Artifactory ) after entering password and we can docker pull it as well

docker login fa-docker-snapshot-local.docker.comp.dev -u svc-faselect
Login succeeded

这样我们就可以成功拉取了,镜像路径和手动docker pull时一样:

So we can pull it successfully and the image path is the same like when doing manually docker pull:

   image: fa-docker-snapshot-local.docker.comp.dev/fa/ads:test1 

我们有用于部署的 YAML 文件,并尝试使用来自 SAME 服务器的 az 命令创建容器.在 YAML 文件中,我们设置了相同的注册表信息:服务器、用户名和密码以及相同的图像

We have YAML file for deploy, and trying to create container using the az command from the SAME server. In the YAML file we have set up the same registry information: server, username and password and the same image

az container create --resource-group FRONT-SELECT-NA2 --file ads-azure.yaml

当我们尝试执行此命令时,需要 30 分钟,然后显示消息:部署失败.操作失败,状态为 200:资源状态失败"

When we try to execute this command, it takes for 30 minutes and after that message is displayed: "Deployment failed. Operation failed with status 200: Resource State Failed"

完整的 Yaml:

apiVersion: '2019-12-01'
location: eastus2
name: ads-test-group
properties:
  containers:
  - name: front-arena-ads-test
    properties:
      image: fa-docker-snapshot-local.docker.comp.dev/fa/ads:test1
      environmentVariables:
        - name: 'DBTYPE'
          value: 'odbc'
      command:
      - /opt/front/arena/sbin/ads_start
      - ads_start
      - '-unicode'
      - '-db_server test01'                        
      - '-db_name HEDGE2_ADM_Test1'                        
      - '-db_user sqldbadmin'                              
      - '-db_password pass'                   
      - '-db_client_user HEDGE2_ADM_Test1'                
      - '-db_client_password Password55'                
      ports:
      - port: 9000
        protocol: TCP
      resources:
        requests:
          cpu: 1.0
          memoryInGB: 4
      volumeMounts:
      - mountPath: /opt/front/arena/host
        name: ads-filesharevolume
  imageRegistryCredentials: # Credentials to pull a private image
  - server: fa-docker-snapshot-local.docker.comp.dev
    username: svcacct-faselect
    password: test
  ipAddress:
    type: Private
    ports:
    - protocol: tcp
      port: '9000'
  volumes:
  - name: ads-filesharevolume
    azureFile:
      sharename: azurecontainershare
      storageAccountName: frontarenastorage
      storageAccountKey: kdUDK97MEB308N=
  networkProfile:
    id: /subscriptions/746feu-1537-1007-b705-0f895fc0f7ea/resourceGroups/SELECT-NA2/providers/Microsoft.Network/networkProfiles/fa-aci-test-networkProfile
  osType: Linux
  restartPolicy: Always
tags: null
type: Microsoft.ContainerInstance/containerGroups

您能帮我们解释一下为什么会出现这个错误吗?谢谢

Can you please help us why this error occurs? Thank you

推荐答案

据我所知,你的YAML文件没有问题,我只能给你一些可能的原因.

According to my knowledge, there is nothing wrong with your YAML file, I only can give you some possible reasons.

  1. 确保配置正确,服务器URL、用户名和密码,还包括图片名称和标签;
  2. 将端口从'9000'改为9000``,我的意思是去掉双引号;
  3. 查看 注意,可能挂载卷会导致容器崩溃.然后你需要将文件共享挂载到一个新文件夹,我的意思是以前不存在的新文件夹.
  1. Make sure the configurations are all right, the server URL, username, and password, also include the image name and tag;
  2. Change the port from '9000' into 9000``, I mean remove the double quotes;
  3. Take a look at the Note, maybe the mount volume makes a crash to the container. Then you need to mount the file share to a new folder, I mean the new folder that does not exist before.

这篇关于Azure 容器部署 - “操作失败,状态为 200:资源状态失败"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆