0

Anyone know of a command or PowerShell script to get the current failoverCount and lastFailover datetime in a Windows Failover Cluster? I have a 2-node cluster that doesn't automatically failover sometimes. The group is configured with the default values of max 1 failure every 6 hours. After reviewing the log files from Get-ClusterLog I've seen a pattern:

When it works and successfuly does a failover to the other node, the log file will have:

  • time since last failure is greater than failover period; resetting failoverCount to 0.
  • Failing over group ME-AG, failoverCount 1, last time 2020/09/17-00:00:23.017.

When it fails and the cluster resources go down, the log file will have:

  • Not failing over group ME-AG, failoverCount 2, failoverThresholdSetting 4294967295, lastFailover 1601/01/01-00:00:00.000

The lastFailover date being 410 years ago is probably because it's currently a null value. Get-ClusterGroup ME-AG shows the values for FailoverPeriod and FailoverThreshold but I can't seem to dig out where WSFC is getting the values for failoverCount and lastFailover.

Marc
  • 1
  • Possibly related: https://dba.stackexchange.com/questions/131634/availability-group-how-to-determine-last-failover-time – Doug Deden Sep 24 '20 at 15:20
  • Thanks @DougDeden `Get-WinEvent` does show the dates of the failovers but it doesn't match the lastFailover date, obviously. My server keeps 10 days of those logs but I had this happen with only 8 days between events, so it shouldn't have been a null value if it was using that same call. – Marc Sep 24 '20 at 16:37

0 Answers0