我在Azure中使用Chef插件安装了一个新的Win2012虚拟机,并将其连接到manage.Chef.io。添加了一本使用WebPi食谱安装ServiceBus及其依赖项的食谱。安装失败,出现以下错误:
“Error opening installation log file. Verify that the specified log file location exists and is writable.”
经过一些搜索,根据这篇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:Windowssystem32configsystemprofileAppDataLocalMicrosoftWeb Platform Installerlogsinstall2015-05-11T14.15.51WindowsFabric.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
厨师联系人(谢谢Bryan!)帮助我更好地理解了这个问题。某些WebPI包不尊重提供给WebPIcmd.exe的显式日志路径。作者应在设置该包时将其修复为使用提供的日志路径。所以选项变成了:
- 让作者修复包
- 以具有访问权限的其他用户身份在新的计划任务中运行Chef到AppData文件夹
- 编辑食谱以执行/取消执行注册表编辑,将AppData文件夹临时移动到系统用户具有访问权限。在我的自定义食谱中或分叉WebPI食谱
显然,等待作者(本例中为Microsoft)修复程序包不会很快发生。
考虑到整个想法是在供应时提供配置,并且它只是起作用,改变Azure VM运行Chef的方式是没有意义的。此外,更改默认设置可能会产生意想不到的后果,并将我们置于非标准环境中。
在短期内,我决定更改我定制食谱中的注册表。
registry_key 'HKEY_USERS.DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerUser 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.DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders' do
values [{
:name => "Local AppData",
:type => :expand_string,
:data => '%%USERPROFILE%%AppDataLocal'
}]
end
也可以在WebPI食谱中进行此更改,以解决所有依赖食谱的此问题。我决定在WebPI团队响应框架的功能请求以验证包是否遵循日志路径之前不处理此问题。
http://forums.iis.net/t/1225061.aspx?WebPI+功能+请求+验证+产品+包+日志+路径+使用
请转到并回复此线程,尝试让团队帮助防范此常见的包问题
以下是POWERSHELL的解决方案
我在安装";Service Fabric SDK";在VMSS VM创建期间。还使用了系统用户。
问题:当我用我的";管理员";用户并运行相同的程序,就成功了。
解决方案:如上所述更改注册表项,安装并重置回
这是我使用";powershell";
我将2.reg文件安装到%TEMP%文件夹中。内容是的新旧导出密钥/值
- 插件sf-SDK-temp.reg
Windows Registry Editor Version 5.00
[HKEY_USERS.DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders]
"Local AppData"=hex(2):25,00,54,00,45,00,4d,00,50,00,25,00,00,00
- 插件sf-SDK-orig.reg
Windows Registry Editor Version 5.00
[HKEY_USERS.DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders]
"Local AppData"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,
49,00,4c,00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,
00,4c,00,6f,00,63,00,61,00,6c,00,00,00
将以下代码集成到您的自定义powershelgl脚本中:
Write-Output "Reset LocalApp Folder to TEMP"
Start-Process "$($env:windir)regedit.exe" `
-ArgumentList "/s", "$($env:TEMP)plugin-sf-SDK-temp.reg"
## replace the following lines with your installation - here my SF SDK installation via WebWPIcmd
Write-Output "Installing /Products:MicrosoftAzure-ServiceFabric-CoreSDK"
Start-Process "$($env:programfiles)microsoftweb platform installerWebPICMD.exe" `
-ArgumentList '/Install', `
'/Products:"MicrosoftAzure-ServiceFabric-CoreSDK"', `
'/AcceptEULA', "/Log:$($env:TEMP)WebPICMD-install-service-fabric-sdk.log" `
-NoNewWindow -Wait `
-RedirectStandardOutput "$($env:TEMP)WebPICMD.log" `
-RedirectStandardError "$($env:TEMP)WebPICMD.error.log"
Write-Output "Reset LocalApp Folder to ORIG"
Start-Process "$($env:windir)regedit.exe" `
-ArgumentList "/s", "$($env:TEMP)plugin-sf-SDK-orig.reg"