A cluster you have never seen fail over is a cluster you are hoping works. This test switches off a host without warning and watches the cluster restart its virtual machine on the other one.
You know the cluster recovers by itself, and how long it takes.
A failover that has never been tested tends to fail the first time it is needed.
Start a watcher, switch off the host running the VM, and time how long the VM takes to return.
The VM on the host you switch off is stopped as if its power was cut, then started again elsewhere. Do this with a test VM, or outside school hours.
Find out which host the VM is on
Get-ClusterGroup 'CON-TEST-01' | Format-Table Name, OwnerNode, State -AutoSize
This guide assumes it is on CON-HV-02. That is the host you will switch off. Run the next step on the other one.
Start a watcher
This prints a line every ten seconds and stops when the VM is running on the surviving host.
$end = (Get-Date).AddMinutes(8)
while ((Get-Date) -lt $end) {
$g = Get-ClusterGroup 'CON-TEST-01'
$n = (Get-ClusterNode 'CON-HV-02').State
"{0:HH:mm:ss} VM on {1} ({2}) CON-HV-02 is {3}" -f (Get-Date), $g.OwnerNode, $g.State, $n
if ($g.OwnerNode.Name -eq 'CON-HV-01' -and $g.State -eq 'Online') { 'Failed over to CON-HV-01.'; break }
Start-Sleep -Seconds 10
}Switch the host off
On a physical server, hold the power button or use its remote management card. If the host is itself a VM, turn it off from the machine it runs on:
Stop-VM 'CON-HV-02' -TurnOff -Force
Watch
| When | What you see |
|---|---|
| Within 20 seconds | The host shows as Down. |
| For about four minutes | Nothing else changes. The VM still shows against the dead host. |
| After about four minutes | The VM shows Online on the surviving host. |
Windows cannot tell a dead host from one that has lost its network for a moment. It waits 240 seconds before restarting VMs elsewhere, so a brief blip does not restart everything. Do not switch the host back on during the wait, or you cancel the test.
Bring the host back
Switch it on again. After two or three minutes:
Get-ClusterNode | Format-Table Name, State -AutoSize
Get-ClusterGroup 'CON-TEST-01' | Format-Table Name, OwnerNode, State -AutoSize
Get-ClusterSharedVolume | Format-Table Name, State, OwnerNode -AutoSize
Invoke-Command -ComputerName CON-HV-02 -ScriptBlock { @(Get-IscsiSession | Where-Object IsConnected).Count }| Check | What you want |
|---|---|
| Nodes | Both Up. The host rejoins by itself. |
| VM | Still Online on the surviving host. It does not move back by itself. |
| Shared volume | Online. |
| Last line | The host's storage connections, back to the full number. Four, with two shares on two paths. |
Things to know
- A failover is a restart, not a seamless move. The VM starts again from cold on the other host. Anything not saved inside it is lost, as with a power cut.
- The wait can be shortened.
(Get-Cluster).ResiliencyDefaultPeriodholds the number of seconds. Lower it only if short network blips are rare on your network. - Planned work is different. For updates, move the VMs off first with a live migration, so nothing restarts.
- Write the result down. Note the date and how long recovery took. It is useful evidence that your recovery plan works.
Done when
The VM came back on the surviving host without anyone touching it, and the failed host rejoined the cluster with its storage reconnected.


