gpt4 book ai didi

azure - Chef 节点在首次启动期间未始终在服务器上保存运行列表 - Azure Scale set VM

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

我目前正在托管一个运行 Windows Server 2012 R2 的 Azure 规模集,该规模集使用 Chef 扩展 (Chef.Bootstrap.WindowsAzure.ChefClient) 设置。配置 VM 后,扩展会通过 Azure 门户报告已成功,但 Chef 服务器上的注册节点不会更新以保留提供的运行列表,并且首次运行未完全完成。这导致后续的 Chef 客户端运行使用空的运行列表来执行。当我观察 Chef 服务器上的报告时,我看到运行状态为中止,没有错误。

查看 WindowsAzure 插件 Chef-client.log 文件后,我可以看到它尝试执行运行列表,但似乎被以下致命消息中断

FATAL: Errno::EINVAL: Invalid argument @ io_writev - <STDOUT>

也没有创建 Chef-stacktrace.out 文件。 ARM 扩展定义如下所示:

{
"type": "extensions",
"name": "ChefClient",
"properties": {
"publisher": "Chef.Bootstrap.WindowsAzure",
"type": "ChefClient",
"typeHandlerVersion": "1210.12",
"autoUpgradeMinorVersion": true,
"settings": {
"client_rb": "ssl_verify_mode :verify_none\nnode_name ENV[\"COMPUTERNAME\"]",
"runlist": "recipe[example]",
"autoUpdateClient": "false",
"deleteChefConfig": "false",

"bootstrap_options": {
"chef_server_url": "https://mychefserver.com/organizations/myorg",
"validation_client_name": "myorg-validator",
"environment": "dev"
}
},
"protectedSettings": {
"validation_key": "-----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY----"
}
}
}

为了排除故障,我尝试减少我的 example Recipe 简化为安装 IIS 的单个 DSC 脚本。即使这一步,我也通过多种方式执行,例如使用 windows_feature、powershell_script 和 dsc_script。所有结果都会出现相同的错误。这是当前脚本

powershell_script 'Install IIS' do
code 'Add-WindowsFeature Web-Server'
guard_interpreter :powershell_script
not_if "(Get-WindowsFeature -Name Web-Server).Installed"
end

如果我覆盖运行列表并手动调用 Chef-client,一切都会成功。我无法确定这是 Azure Chef 扩展、Chef 客户端还是说明书。

据我所知,与 Chef 服务器的通信看起来很好,因为交换了必要的 pem 文件,安装了 Chef-client,并且从服务器下载并缓存了说明书。但是,缓存会在后续运行中被删除,并且运行列表为空。以下是first-boot.json的内容:

{"run_list":["recipe[example]"]}

以下是正在使用的版本:

  • Chef 客户端版本:14.1.12
  • Azure Chef 扩展版本:1210.12.110.1001
  • 服务器版本:Windows Server 2012 R2

有什么想法会发生什么吗?

最佳答案

事实证明,我对导致问题的资源的分析是错误的。使用 dsc_script 作为安装 Web 服务器的资源时,第一次引导运行似乎失败。当使用以下 powershell_script 资源时,它成功了,并附加了运行列表以供将来运行。

powershell_script '安装 IIS' 执行
代码“Add-WindowsFeature Web-Server”
Guard_interpreter:powershell_script
not_if "(Get-WindowsFeature -Name Web-Server).Installed"
结束

关于azure - Chef 节点在首次启动期间未始终在服务器上保存运行列表 - Azure Scale set VM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50440965/

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