【问题标题】:Azure VM creation fails because of invalid username由于用户名无效,Azure VM 创建失败
【发布时间】:2017-07-16 15:43:44
【问题描述】:

我正在尝试在门户中创建一个新的 Docker for Azure CE VM

我使用Authentication typePassword 适当配置所有设置。

但是它总是无法部署,总是出现这个错误:

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.","details":[{"code":"Conflict","message":"{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"OSProvisioningClientError\",\r\n \"message\": \"Username specified for the VM is invalid for this Linux distribution. Error details: (000004)Failed to handle ovf-env.xml: (000007)Failed to create user account:waterloo, retcode:127, output:/bin/sh: useradd: not found\\n.\"\r\n }\r\n ]\r\n }\r\n}"}]}

我这次设置的User namewaterloo,但它也无法与我尝试过的所有其他用户名一起使用。

那么,它使用的是什么 Linux 发行版,用户名政策是什么?

-

抱歉,如果这很明显,或者我提到的东西不正确,我才刚刚开始尝试学习 Azure。目前我正在评估 Azure 或 AWS 是否适合我的项目。

谢谢!

【问题讨论】:

  • 我会在 Server Fault 处询问这个问题。但我不认为这是用户名政策问题。错误在发布的消息中:output:/bin/sh: useradd: not found。无论您配置什么映像,都没有useradd 实用程序。 Azure 很可能正在使用 cloud-init 或其他预配系统,这些系统依赖于映像中可用的某些二进制文件。 Docker 镜像不能有这些可用的。不过,需要更多信息以便有人可以重现(创建 VM 时采取了哪些设置/步骤)。
  • 你使用的是什么基础镜像?

标签: linux azure docker


【解决方案1】:

当我通过 Azure 门户为 Azure CE VM 创建 Docker 时,我遇到了同样的错误。 要创建这个虚拟机,我们应该将用户名指定为 docker

据我所知,我认为这个模板有问题。

这个虚拟机的镜像发布者是docker,产品是docker-ce

"plan": {
                "name": "docker-ce",
                "publisher": "docker",
                "product": "docker-ce"
            },

此图片仅支持用户名“docker”。

所以我们可以将用户名指定为docker 来创建它。

模板应该是这样的:

"osProfile": {
                        "computerNamePrefix": "[parameters('virtualMachineName')]",
                        "adminUsername": "docker",

默认情况下,当您通过 SSH 连接到管理员时,您将以 常规用户名:docker

有关 Azure CE vm 的 docker 的更多信息,请参阅此link

【讨论】:

  • 只有当我将用户名指定为docker 时,我才能部署机器。谢谢!
  • 请注意,使用密码也无法部署,声称这是“内部错误”。您必须使用“docker”用户名和 SSH 登录
猜你喜欢
  • 1970-01-01
  • 2022-06-14
  • 2017-06-08
  • 1970-01-01
  • 1970-01-01
  • 2019-08-12
  • 1970-01-01
  • 2021-07-30
  • 1970-01-01
相关资源
最近更新 更多