【问题标题】:DSC Automation doesn't run until instance has been restarted, but says it's compliantDSC 自动化在实例重新启动之前不会运行,但表示它是合规的
【发布时间】:2017-09-26 12:45:55
【问题描述】:

我正在尝试将新的 Windows Server 2016 服务器注册到 Azure 自动化中,作为 DSC 节点。我正在使用脚本here 这样做。脚本运行后,报告会出现在节点旁边的自动化中,标记为“一致性”,状态为“合规”。然而,报告似乎什么也没做,没有生成资源,尽管配置正确。

我发现它什么也没做,直到我重新启动机器,然后 PowerShell DSC 再次开始运行,并按预期生成所有资源。 (见下面两份报告的截图)。

我检查了原始日志,并在第一份报告中收到此消息:

Registration of the Dsc Agent with the server https://ne-agentservice-prod-1.azure-automation.net/accounts/(removed) failed. The underlying error is: The attempt to register Dsc Agent with AgentId (removed) with the server https://ne-agentservice-prod-1.azure-automation.net/accounts/(removed)/Nodes(AgentId=\\(removed)) returned unexpected response code BadRequest.

我可以在日志中看到这一点:

Performing the operation \"Start-DscConfiguration: \r\nSendMetaConfigurationApply\" on target \"MSFT_DSCLocalConfigurationManager\".\nVERBOSE: Perform operation 'Invoke CimMethod' with following parameters, \r\n''methodName' = SendMetaConfigurationApply,'className' = \r\nMSFT_DSCLocalConfigurationManager,'namespaceName' = \r\nroot/Microsoft/Windows/DesiredStateConfiguration'.\nVERBOSE: An LCM method call arrived from computer (removed) with user sid\r\n S-1-5-18.\n\tFailed to apply SetupLCM DSC Configuration to self!\n\tError details: Microsoft.Management.Infrastructure.CimException: Cannot invoke the Set-DscLocalConfigurationManager cmdlet. The Consistency Check or Pull cmdlet is in progress and must return before Set-DscLocalConfigurationManager can be invoked. Use -Force option if that is available to cancel the current operation.

这在事件查看器中:

我无法确定自动化中是否存在错误、我用来注册的脚本或问题实际出在哪里。我也不明白为什么重启可以解决问题,当我第一次开始测试注册 DSC 时,它不需要重启。

【问题讨论】:

    标签: powershell azure dsc azure-automation


    【解决方案1】:

    这是一个已知问题。 Azure 自动化尚未正式支持部分配置。您可以在Azure Automation UserVoice

    投票支持

    也就是说,您可以看看DSC Composite Resources,因为几乎所有部分配置的情况都可以通过它完成。

    【讨论】:

    • 我目前没有使用部分配置。是否还有其他可能导致此问题的自动化问题?
    • 您提供的 github 链接中的脚本似乎生成了部分配置。该脚本顶部的注释也提供了一些解释。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多