vCenter Server电源恢复

我正在编写一个脚本和文档来pipe理我的设施的停电。 我有一个脚本,自动closures我的硬件干净。

我的集群上也configuration了VMware HA。 理想情况下,当我通电备份群集时,所有虚拟机都应按照HAconfiguration中列出的顺序启动。 我需要启用哪个HA选项来执行此操作? 这显然不是我可以在生产中自由testing的东西,我没有这种东西的testing环境。

我原本以为个别服务器下面列出的虚拟机启动/closures选项可以做到这一点,但是在使用vCenter Server时这些设置显然是被禁用的。

编辑:我有VMware HA虚拟机选项设置为使用我想要使用的顺序。 如果我的理解是正确的,那么根本的问题是HAfunction将不会重新启动已经被有效手动closures的VM。 我还包括了我的关机脚本的相关function。

Function VMWareServer # This function will shut down all virtual machines and then a VMware environment. { param( [string]$Server, [string]$ID, [string]$Password ) Write-Host Connecting to $Server .. Connect-VIServer $Server -User $ID -Password $Password Write-Host Getting virtual machines... $ESXSRV = Get-VMHost Foreach ($VM in ($ESXSRV | Get-VM)) { Write-Host Shut Down $VM If( $shutdown ) { $VM | Shutdown-VMGuest -Confirm:$false } } If( $shutdown ) { # The following lines shut down the remaining VMs and shut down # the VMware servers. Write-Host Waiting for shutdown to complete, be patient sleep 30 $activeVMs = ($ESXSRV | Get-VM | Where { $_.PowerState -eq "poweredOn" }).Count Write-Host Sleepy VMs: $activeVMs If( $activeVMs > 0 ) { Write-Host Giving remaining VMs 90 seconds to shut down... sleep 90 } $ESXSRV | Foreach {Get-View $_.ID} | Foreach {$_.ShutdownHost_Task($TRUE)} } Disconnect-VIServer -Server * -Force -Confirm:$False } 

你是否进入虚拟机启动和关机属性 (右上angular),并勾选允许虚拟机自动启动和停止与系统checkbox?

由于这个问题的复杂性,我打算构build一个由两个ESXi节点和一个vSphere Server组成的整个虚拟集群。 我认为没有testing就没有现成的答案。 感谢@SpacemanSpiff和@ user48838。