Troubleshooting unexpected FortiGate HA failover and cluster role changes
Confirmed 8/8/2026
Problem
A FortiGate HA cluster may unexpectedly change Primary and Secondary roles. Troubleshooting requires reviewing election history, synchronization, monitored-interface failures, heartbeat status, cluster age, and administrative HA actions.
Symptoms
Unexpected HA transitions; Primary and Secondary role changes; cluster synchronization warnings; monitored interfaces changing state; WAN flapping; heartbeat errors; increasing link_failure or reset_cnt values; or health-status errors involving removed or re-added members.
Environment
FortiGate devices in an FGCP High Availability cluster. The procedure assumes HA override is disabled. In a VDOM environment, run the commands under `config system global`.
Root Cause
A transition can be triggered by monitored-interface state changes, heartbeat connectivity problems, differences in link_failure counts during boot, cluster age after the ha-uptime-diff-margin expires, manual uptime resets, HA configuration changes, or changes on connected network devices. A LAG is considered down when all of its members are down. On boot, each monitored interface that is down adds 50 to link_failure; this value is not configurable. If both members boot together, the unit with the lower link_failure count is preferred as Primary. Age is considered only after ha-uptime-diff-margin, which defaults to 300 seconds (5 minutes).
Solution
-
Confirm that HA override is disabled before interpreting the election results. This procedure is based on the default election behavior with override disabled.
-
In a VDOM environment, enter the global configuration context:
config system global
- Review the current cluster state:
get system ha status
Check the warnings near the top of the output, the last four HA historical events and their timestamps, whether the cluster is in sync, and the time of the last synchronization. Inspect heartbeat-interface counters for errors or interfaces changing to down. Near the bottom, verify the Primary and Secondary roles against each hostname.
- Read the persistent election history on each cluster member:
diagnose sys ha history read
The history is limited to 512 entries and persists across reboots. Each unit maintains its own event history. It can be cleared manually, and older entries are overwritten as the history fills. Look for monitored-interface link status changes, where 0 means down and 1 means up. These changes can invoke the election algorithm. The same events may also appear in system event logs.
- If a monitored interface is a LAG, remember that it is treated as down only when all LAG members are down. If appropriate for the design, configure the LAG minimum-link threshold:
config system interface
edit LAG_Interface_Name
set min-links 1
end
min-links 1 is the default. It keeps the LAG up while at least one LACP member remains up.
- Examine link monitoring, interface state, role, and cluster age:
diagnose sys ha dump-by group
Interpret the output as follows:
linkfails=35represents the total number of down interfaces for that serial number.2(work)identifies Primary state2; Secondary state is3.mondevsummarizes each monitored device, where1means up and0means down.uptime cnt=35, reset 3shows cluster uptime and the number of resets.- Cluster uptime resets whenever a
mondevstatus changes.
The link_failure count can also be reviewed with:
diagnose sys ha dump-by vcluster
-
Account for boot-time failure scoring. When a unit boots with monitored interfaces down,
link_failureincreases by 50 for each down interface. This value cannot be configured. For example, three down monitored interfaces producelink_failure=150. If both members boot simultaneously, the unit with the lowestlink_failurecount is preferred as Primary. -
Consider the uptime grace period. Although the cluster can initially prefer the member with fewer failed monitored interfaces, age is considered only after
ha-uptime-diff-margin. The default is 300 seconds, or 5 minutes. Age andlink_failurecan trigger transitions only after the cluster has been running longer than this margin. -
If the monitored-interface list was changed while the cluster was operating, recalculate expectations for
link_failure. The count is reset to reflect the current monitored-interface states. For example, if three down interfaces producedlink_failure=150and two are removed from monitoring, the result becomeslink_failure=50because one down interface remains monitored. -
Inspect interface state and virtual MAC information on both members:
diagnose sys ha mac
In this output, a down interface is shown as 1 and an up interface as 0. In an active-passive cluster, a subordinate unit does not have vMAC information until it becomes Primary.
- If testing requires an intentional uptime reset, run:
diagnose sys ha reset-uptime
This action can cause a cluster transition. The HA history records entries similar to:
<timestamp> FG800D3916801158 is elected as the cluster primary of 2 member
<timestamp> user="admin" ui=ssh(10.10.10.1) msg="Reset HA uptime"
Afterward, the reset unit shows uptime zero, and diagnose sys ha dump-by group or diagnose sys ha dump-by vcluster shows an incremented reset_cnt, for example:
'FG800D3916-----7': ha_prio/o=1/1, link_failure=50, pingsvr_failure=0, flag=0x00000000, mem_failover=0, uptime/reset_cnt=0/4
'FG800D3916801158': ha_prio/o=0/0, link_failure=50, pingsvr_failure=0, flag=0x00000001, mem_failover=0, uptime/reset_cnt=349084/1
- To clear error status associated with cluster members that were removed or re-added, reset HA health status:
diagnose sys ha reset-health-status
-
Physically verify that the heartbeat cable is connected and that the heartbeat ports match between members.
-
Correlate HA history with system event logs. If the WAN is the only HA-monitored interface, check for WAN-flapping events. If redundant WAN links are unavailable, internet connectivity can be interrupted during the failover impact window.
-
After any HA or connected-network change, rerun the applicable test booklet to confirm that the intended topology and failover behavior still operate as designed.
Verification
Run get system ha status and confirm there are no unexpected warnings, the cluster is in sync, heartbeat interfaces are healthy, and the hostnames have the intended Primary and Secondary roles. Run diagnose sys ha history read to confirm that no new unexplained elections or monitored-link changes occur. Use diagnose sys ha dump-by group or diagnose sys ha dump-by vcluster to verify expected mondev, link_failure, uptime, and reset_cnt values. Use diagnose sys ha mac to confirm the expected interface states. Finally, rerun the test booklet after changes.
Tags
No tags yet.
Community rating
— / 5 (0)
Discussion (0)
No comments yet.