Chef WebPI 说明书在 Azure 中安装失败

chi*_*ef7 4 azure web-platform-installer chef-infra

我使用 Chef 插件在 Azure 中设置了一个新的 Win2012 VM,并将其连接到 manage.chef.io。添加了使用 WebPi 说明书安装 ServiceBus 及其依赖项的说明书。安装失败并出现以下错误:

“Error opening installation log file. Verify that the specified log file location exists and is writable.”
Run Code Online (Sandbox Code Playgroud)

经过一番搜索,根据 2013 年的博客文章,这在 Azure 中似乎并不新鲜 - https://nemetht.wordpress.com/2013/02/27/web-platform-installer-in-windows-azure-startup-tasks /

它提供了一种临时禁用文件夹安全性的方法,但我正在寻找更好的解决方案。

有任何想法吗?

更多的日志输出 -

Started installing: 'Microsoft Windows Fabric V1 RTM'

 .  

Install completed (Failure): 'Microsoft Windows Fabric V1 RTM'

 .  

WindowsFabric_1_0_960_0 : Failed.
Error opening installation log file. Verify that the specified log file location exists and is writable.


DependencyFailed: Microsoft Windows Fabric V1 CU1


DependencyFailed: Windows Azure Pack: Service Bus 1.1

 .  
 .. 




Verifying successful installation...


Microsoft Visual C++ 2012 SP1 Redistributable Package (x64) True


Microsoft Windows Fabric V1 RTM                    False


    Log Location: C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\Web Platform Installer\logs\install\2015-05-11T14.15.51\WindowsFabric.txt


Microsoft Windows Fabric V1 CU1                    False


Windows Azure Pack: Service Bus 1.1                False


Install of Products: FAILURE
STDERR: 
---- End output of "WebpiCmd.exe" /Install /products:ServiceBus_1_1 /suppressreboot /accepteula /Log:c:/chef/cache/WebPI.log ----
Ran "WebpiCmd.exe" /Install /products:ServiceBus_1_1 /suppressreboot /accepteula /Log:c:/chef/cache/WebPI.log returned -1
Run Code Online (Sandbox Code Playgroud)

chi*_*ef7 5

Chef 联系人(感谢 Bryan!)帮助我更好地理解了这个问题。某些 WebPI 包不遵守提供给 WebPIcmd.exe 的显式日志路径。作者应该修复包以在设置时使用提供的日志路径。所以选项变成了:

  • 让作者修复包
  • 以有权访问 AppData 文件夹的不同用户身份在新的计划任务中运行 Chef
  • 编辑说明书以执行/取消执行注册表编辑以临时将 AppData 文件夹移动到系统用户有权访问的位置。无论是在我的自定义食谱中还是派生出 WebPI 食谱。

显然,等待作者(在本例中为 Microsoft)修复程序包不会很快发生。

改变 Azure VM 运行 Chef 的方式没有意义,因为整个想法是在供应时提供配置并且它只是工作。此外,更改默认设置可能会产生意想不到的后果,并使我们处于非标准环境中。

在短期内,我决定更改自定义食谱中的注册表。

registry_key 'HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' do
    values [{
        :name => "Local AppData",
        :type => :expand_string,
        :data => "%~dp0appdata"
        }]
        action :create
end
webpi_product 'ServiceBus_1_1' do
    accept_eula true
    action :install
end
webpi_product 'ServiceBus_1_1_CU1' do
    accept_eula true
    action :install
end
registry_key 'HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' do
    values [{
        :name => "Local AppData",
        :type => :expand_string,
        :data => '%%USERPROFILE%%\AppData\Local'
        }]
end
Run Code Online (Sandbox Code Playgroud)

也可以在 WebPI 说明书中进行此更改,以修复所有相关说明书的此问题。我决定在 WebPI 团队响应框架的功能请求以验证包是否遵守日志路径之前不处理这个问题。

http://forums.iis.net/t/1225061.aspx?WebPI+Feature+Request+Validate+product+package+log+path+usage

请前往并回复此线程,以尝试让团队帮助防范这个常见的包问题。