Search This Blog

Wednesday, July 13, 2011

Get-FT.ps1 - A script to get VM's running FT (Fault Tolerance)

This is a short and simple PowerCLI script for vSphere, but because it uses Get-VIEW, it's super fast.

$ft = get-view -ViewType VirtualMachine -filter @{"Config.FtInfo.Role"="1|2|3"}

$ft | select Name, @{N="Role" ; E={$_.Config.FtInfo.Role } }, @{N="RecordReplayState" ; E={$_.Runtime.RecordReplayState } }, @{N="FaultToleranceState" ; E={$_.Runtime.FaultToleranceState} }

Save this to an ANSI text file and run it against your connected vCenter.