【问题标题】:Azure DevOps failed to update image for VMSS. Error: Provisioning of VM extension 'PowershellDSC' has timed outAzure DevOps 无法更新 VMSS 的映像。错误:VM 扩展“PowershellDSC”的配置已超时
【发布时间】:2020-01-03 01:12:25
【问题描述】:

我们在 Azure Devops 中有一个发布管道,它主要执行以下操作:

  • 从 GitHub 存储库中签出代码
  • 将代码上传到 VSO 工件存储
  • 创建一个临时虚拟机来构建
  • 部署服务
  • 运行 PowerShell 脚本
  • 清理模板

这一直有效,直到最近。现在,在 PowerShell 步骤中,我看到以下错误:

Failed to update image for VMSS foo. Error: Provisioning of VM extension 'PowershellDSC' has timed out. Extension installation may be taking too long, or extension status could not be obtained.

在 Azure > 虚拟机规模集 > Foo - Extensions > Extensions 中,我可以看到定义的 POwerShell 扩展,键入 DSC,但删除它会返回相同的消息。

知道为什么会发生这种情况吗?另外,如何在不构建的情况下重现它?

2019 年 11 月 14 日编辑

感谢您的回复。在 Azure > 扩展中,我卸载了扩展,然后重新启动了规模集。然后我恢复了扩展并重新启动了规模集。现在,我遇到了与未找到密钥有关的错误。

    The DSC Extension received an incorrect input: Value for password key 'registrationKeyPrivate' is missing

这是我正在运行以安装 PowerShell DSC 扩展的命令:

    'az vmss extension set --vmss-name MyVmss --name DSC --resource-group MyVmssGroup  --version 2.76.0.0 --publisher Microsoft.Powershell --extension-instance-name MyPowershellDSCExt --settings  C:\Users\me\mylmsconfig.json'

mylmsconfig.json 包含以下内容以配置指向 Azure 自动化 DSC 的 LMS:

    {
      "Properties": [
        {
  "Name": "RegistrationKey",
  "Value": {
    "UserName": "PLACEHOLDER_DONOTUSE",
    "Password": "PrivateSettingsRef:registrationKeyPrivate"
  },
  "TypeName": "PSCredential"
},
{
  "Name": "RegistrationUrl",
  "Value": "https://uks-agentservice-prod-1.azure-automation.net/accounts/myautomationservice",
  "TypeName": "System.String"
},
{
  "Name": "NodeConfigurationName",
  "Value": "bindingsname.localhost",
  "TypeName": "System.String"
},
{
  "Name": "ConfigurationMode",
  "Value": "ApplyandAutoCorrect",
  "TypeName": "System.String"
    }
    ]
    }

“registrationKeyPrivate”需要在哪里定义?在虚拟机上运行 Get-DscLocalConfigurationManager 后,我希望看到上述详细信息反映在 LMS 配置中。

【问题讨论】:

  • 好吧,调试你的扩展,为什么你的 powershell dsc 配置超时。这就是你问题的答案
  • 您可以在 C:\WindowsAzure\Logs\WaAppAgent.log 中查看(对于 Windows,/var/log/waagent.log 对于 Linux GA 日志),并查看可能是什么问题阻止 DSC 运行的框。如果是 GA 问题,那么所有其他扩展也应该受到影响,如果是 DSC 设置问题,何时会在日志中以及 DSC 扩展本身的 CommandExecution.log 中明确。

标签: azure powershell azure-devops azure-vm-scale-set


【解决方案1】:

我决定使用 PowerShell 脚本和 vmss 扩展来执行相同操作,而不是使用 DSC 扩展在规模集中的虚拟机上注册 DSC 拉取服务器。这有效 - 只是另一种注册 DSC 拉服务器的方式。

我怀疑使用较旧的 VMSS DSC 扩展存在问题,或者传入的凭据不正确。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-11
    相关资源
    最近更新 更多