2014-05-22 37 views

回答

1

windows cookbook提供reboot資源。

+0

,虛擬機實際上是沒有得到重新啓動,我摹出現以下錯誤錯誤:WinRM :: WinRMHTTPTransportError:從服務器返回的錯誤HTTP響應(500) –

1

如上所述檢查鏈接windows cookbook & windows reboot。我的所有信息都是從以前的鏈接中收集的。

附上WindowsRebootHandler在配方

include_recipe 'windows::reboot_handler' 

創建重新引導塊

windows_reboot 30 do 
    timeout 30 
    reason 'Restarting computer in 30 seconds!' 
    action :nothing 
end 
  • 超時:在重新啓動之前超時延遲(秒)。默認爲60秒
  • 原因:重新啓動的原因。默認爲「Opscode公司的廚師開始重啓」

通知重啓塊觸發重啓

notifies :request, 'windows_reboot[30]', :delayed 
  • :延遲 - 通知排隊,並在廚師的客戶端運行的最末端執行
  • :立即 - 當我使用reboot資源通知立即跑
+0

當我使用重新啓動資源,虛擬機實際上沒有重新啓動,並且出現以下錯誤 錯誤:WinRM: :WinRMHTTPTransportError:從服務器返回的錯誤HTTP響應(500) –

+0

似乎WinRM沒有在目標服務器上正確設置,但很難說不知道您使用的Chef命令。我之前已經解釋過Windows Chef bootstrap [這裏](https://stackoverflow.com/questions/23813486/unable-to-bootstrap-chef-on-windows/23919580#23919580)。 – Sanderp