Checking the Cluster Health

You can use the special failover command execute ha failover set <cluster_id> to check the health of the HA cluster. HA failover can be forced on an HA primary device. The device will stay in a failover state regardless of the conditions. The only way to remove the failover status is by manually turning it off. This command should only be used for testing, troubleshooting, and demos. Do not use it in live environment.

To manually force an HA failover, run the following in CLI:

#execute ha failover set 1
Caution: This command will trigger an HA failover. 
It is intended for testing purposes.
Do you want to continue? (y/n) y

After that, you will log out of the system. Then enter the credentials of the user configured on the primary device. After logging in, by the hostname of the device, you can see that a switch to an additional device has occurred.

To view the failover status:

#get system ha status
HA Health Status: OK
Model: FortiGate-VM64-KVM
Mode: HA A-P
Group: 0
Debug: 0
Cluster Uptime: 0 days 11:13:45
Cluster state change time: 2020-08-24 01:43:55
Master selected using:
    <2020/08/24 01:43:55> FGVMEV6UTHPHYC67 is selected as the master because it has EXE_FAIL_OVER flag set.
    <2020/08/24 01:35:48> FGVMEVZ0PVYJZL93 is selected as the master because it has the largest value of serialno.
    ses_pickup: disable
override: disable
Configuration Status:
    FGVMEV6UTHPHYC67(updated 2 seconds ago): in-sync
    FGVMEVZ0PVYJZL93(updated 4 seconds ago): in-sync
System Usage stats:
    FGVMEV6UTHPHYC67(updated 2 seconds ago):
        sessions=30, average-cpu-user/nice/system/idle=3%/0%/1%/96%, memory=86%
    FGVMEVZ0PVYJZL93(updated 4 seconds ago):
        sessions=1, average-cpu-user/nice/system/idle=0%/0%/1%/99%, memory=87%
HBDEV stats:
    FGVMEV6UTHPHYC67(updated 2 seconds ago):
        port2: physical/10000full, up, rx-bytes/packets/dropped/errors=6571730/20477/0/0, tx=4972746/17325/0/0
        port3: physical/10000full, up, rx-bytes/packets/dropped/errors=4621358/13249/0/0, tx=3582656/10195/0/0
    FGVMEVZ0PVYJZL93(updated 4 seconds ago):
        port2: physical/10000full, up, rx-bytes/packets/dropped/errors=75651874/243087/0/0, tx=105052814/262332/0/0
        port3: physical/10000full, up, rx-bytes/packets/dropped/errors=66959742/189744/0/0, tx=71550156/201895/0/0
Master: FG-2            , FGVMEV6UTHPHYC67, HA cluster index = 1
Slave : FG-1            , FGVMEVZ0PVYJZL93, HA cluster index = 0
number of vcluster: 1
vcluster 1: work 169.254.0.2
Master: FGVMEV6UTHPHYC67, HA operating index = 0
Slave : FGVMEVZ0PVYJZL93, HA operating index = 1

In this summary, you can see the reason for the failover, confirming that a forced failover has occurred.

To stop the failover status:

# execute ha failover unset 1
Caution: This command may trigger an HA failover.
It is intended for testing purposes.
Do you want to continue? (y/n) y

To view the system status of a device after forced HA failover is disabled:

# get system ha status
HA Health Status: OK
Model: FortiGate-VM64-KVM
Mode: HA A-P
Group: 0
Debug: 0
Cluster Uptime: 0 days 11:19:32
Cluster state change time: 2020-08-24 01:52:17
Master selected using:
    <2020/08/24 01:52:17> FGVMEVZ0PVYJZL93 is selected as the master because it has the largest value of serialno.
    <2020/08/24 01:43:55> FGVMEV6UTHPHYC67 is selected as the master because it has EXE_FAIL_OVER flag set.
    <2020/08/24 01:35:48> FGVMEVZ0PVYJZL93 is selected as the master because it has EXE_FAIL_OVER flag set.
    <2020/08/24 01:27:54> FGVMEVZ0PVYJZL93 is selected as the master because it has the largest value of uptime.
ses_pickup: disable
override: disable
Configuration Status:
    FGVMEVZ0PVYJZL93(updated 0 seconds ago): in-sync
    FGVMEV6UTHPHYC67(updated 3 seconds ago): in-sync
System Usage stats:
    FGVMEVZ0PVYJZL93(updated 0 seconds ago):
        sessions=29, average-cpu-user/nice/system/idle=1%/0%/2%/97%, memory=88%
    FGVMEV6UTHPHYC67(updated 3 seconds ago):
        sessions=5, average-cpu-user/nice/system/idle=0%/0%/0%/100%, memory=87%
HBDEV stats:
    FGVMEVZ0PVYJZL93(updated 0 seconds ago):
        port2: physical/10000full, up, rx-bytes/packets/dropped/errors=76568891/245473/0/0, tx=105800334/264683/0/0
        port3: physical/10000full, up, rx-bytes/packets/dropped/errors=67584767/191495/0/0, tx=72167809/203663/0/0
    FGVMEV6UTHPHYC67(updated 3 seconds ago):
        port2: physical/10000full, up, rx-bytes/packets/dropped/errors=7306532/22779/0/0, tx=5880277/19685/0/0
        port3: physical/10000full, up, rx-bytes/packets/dropped/errors=5228603/14979/0/0, tx=4200271/11932/0/0
Master: FG-1            , FGVMEVZ0PVYJZL93, HA cluster index = 0
Slave : FG-2            , FGVMEV6UTHPHYC67, HA cluster index = 1
number of vcluster: 1
vcluster 1: work 169.254.0.1
Master: FGVMEVZ0PVYJZL93, HA operating index = 0
Slave : FGVMEV6UTHPHYC67, HA operating index = 1