gpt4 book ai didi

azure - Packer azure-arm vhd 构建失败,找不到资源组

转载 作者:行者123 更新时间:2023-12-03 04:02:19 28 4
gpt4 key购买 nike

我在使用 Packer 和 Azure Stack 时遇到问题,我正在尝试在 azure stack 中构建图像,但看起来 packer 不尝试使用我的自定义 url。

{
"builders": [{
"type": "azure-arm",

"client_id": "client_id",
"client_secret": "client_secret",
"tenant_id": "tenant_id",
"subscription_id": "subscription_id",

"managed_image_resource_group_name": "resource_group_name",
"managed_image_name": "random_name",

"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "18.04-LTS",

"azure_tags": {
"dept": "Engineering",
"task": "Image deployment"
},

"location": "custom_location",
"vm_size": "Standard_DS2_v2"
}],
"provisioners": [{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get upgrade -y",
"apt-get -y install nginx",

"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}]
}

错误

azure-arm: output will be in this color.

==> azure-arm: Running builder ...
==> azure-arm: Getting tokens using client secret
==> azure-arm: Getting tokens using client secret
azure-arm: Creating Azure Resource Manager (ARM) client ...
Build 'azure-arm' errored: Cannot locate the managed image resource group resource_group_name.

==> Some builds didn't complete successfully and had errors:
--> azure-arm: Cannot locate the managed image resource group olaf.

==> Builds finished but no artifacts were created.

但是凭据是正确的,我可以使用 ServiceAccount/App 凭据登录并列出所有资源组。看起来一切正常。

有人知道如何让 Packer 使用 azure stack 吗?有没有办法提供堆栈域而不是原始的 azure 域或类似的东西?

谢谢! =)

最佳答案

我知道这个问题很老了,您可能已经弄清楚了,但我今天遇到了同样的问题,并认为为遇到此问题的其他人添加我的解决方案可能会有所帮助:

确保您的服务主体已作为贡献者添加到资源组中。

  • 在 Azure 门户中,导航到目标资源组

  • 点击左侧的“访问 (IAM)”。

  • 点击顶部的“添加”并搜索服务主体

关于azure - Packer azure-arm vhd 构建失败,找不到资源组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61661051/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com