Chapter 9 High Availability : An introduction to the FGCP : Primary unit selection : Primary unit selection and age : Displaying cluster unit age differences
  
Displaying cluster unit age differences
You can use the CLI command diagnose sys ha dump-by all-vcluster to display the age difference of the units in a cluster. This command also displays information about a number of HA‑related parameters for each cluster unit. You can enter the command from the primary unit CLI or you can enter the command from a subordinate unit after using execute ha manage to log into a subordinate unit CLI. The information displayed by the command is relative to the unit that you enter the command from.
For example, a cluster of two FortiGate-5001C units with no changes to the default HA configuration except to enable port monitoring for port1. Entering the diagnose sys ha dump-by all-vcluster command from the primary unit CLI displays information similar to the following:
diagnose sys ha dump-by all-vcluster
            HA information.
vcluster id=1, nventry=2, state=work, digest=4.e8.62.17.7b.1d...
ventry idx=0,id=1,FG-5KC3E13800084,prio=128,0,claimed=0,override=0, flag=0x01,time=0,mon=0
mondev=port1,50
ventry idx=1,id=1,FG-5KC3E13800051,prio=128,0,claimed=0,override=0, flag=0x00,time=189,mon=0
The command displays one ventry line for each cluster unit. The first ventry in the example contains information for the cluster unit that you are logged into (usually the primary unit). The other ventry lines contain information for the other units in the cluster (in the example there is only one other cluster unit). The command also includes a mondev entry that displays the interface monitoring configuration.
The time field is always 0 for the unit that you are logged into. The time field for the other cluster unit is the age difference between the unit that you are logged into and the other cluster unit. The age difference is in the form seconds/10.
In the example, the age of the subordinate unit is 18.9 seconds more than the age of the primary unit. The age difference is less than 5 minutes (less than 300 seconds) so age has no affect on primary unit selection. The cluster selected the unit with the highest serial number to be the primary unit.
If you use execute ha manage 1 to log into the subordinate unit CLI and enter diagnose sys ha dump 1 you get results similar to the following:
diagnose sys ha dump-by all-vcluster
            HA information.
vcluster id=1, nventry=2, state=standy, digest=4.e8.62.17.7b.1d...
ventry idx=1,id=1,FG-5KC3E13800051,prio=128,0,claimed=0,override=0, flag=0x01,time=0,mon=0
mondev=port1,50
ventry idx=0,id=1,FG-5KC3E13800084,prio=128,0,claimed=1,override=0, flag=0x00,time=-189,mon=0
The time for the primary unit is -189, indicating that age of the subordinate unit age is 18.9 seconds higher than the primary unit age.
If port1 (the monitored interface) of the primary unit is disconnected, the cluster renegotiates and the former subordinate unit becomes the primary unit. When you log into the new primary unit CLI and enter diagnose sys ha dump-by all-vcluster you could get results similar to the following:
diagnose sys ha dump-by all-vcluster
            HA information.
vcluster id=1, nventry=2, state=work, digest=3.f8.d1.63.4d.d2...
ventry idx=0,id=1,FG-5KC3E13800046,prio=128,0,claimed=0, override=0,flag=1,time=0,mon=0
mondev=port1,50
ventry idx=1,id=1,FG-5KC3E13800084,prio=128,-50,claimed=0, override=0,flag=0,time=1362,mon=0
The command results show that the age of the new primary unit is 136.2 seconds higher than the age of the new subordinate unit.
If port1 of the former primary unit is reconnected the cluster will once again make this the primary unit because the age difference will still be less than 300 seconds. When you log into the primary unit CLI and enter diagnose sys ha dump-by all-vcluster you get results similar to the following:
diagnose sys ha dump-by all-vcluster
            HA information.
vcluster id=1, nventry=2, state=work, digest=4.a5.60.11.cf.d4...
ventry idx=0,id=1,FG-5KC3E13800084,prio=128,0,claimed=0, override=0,flag=1,time=0,mon=0
mondev=port1,50
ventry idx=1,id=1,FG-5KC3E13800046,prio=128,0,claimed=0, override=0,flag=0,time=-1362,mon=0