Created on
08-03-2023
06:19 AM
Edited on
11-21-2024
09:42 PM
By
Anthony_E
Description |
This article describes how to automate the HA cluster reboot. |
Scope |
FortiGate. |
Solution |
The High Availability (HA) cluster may require scheduled reboots in various scenarios.
This can be done with an automation script whose action is set as a CLI script and which uses the command 'execute reboot'. This will reboot the primary device, and all traffic will failover to the secondary.
In this test scenario, both the primary and secondary devices have different uptimes.
To reboot the cluster at the same time, set the automation-destination on automation-stitch.
Step 1: Create an automation-destination.
config system automation-destination edit "rebootPrimary" set destination "FGT60FTK20006777" <- Primary Device SN. next edit "rebootSeconday" set destination "FGT60FTK20008823" <- Secondary Device SN. next end
Step 2: Create an automation action and configure a script to reboot the devices.
config system automation-action edit "RebootFGTCLI" set action-type cli-script set script "execute reboot" set accprofile "super_admin" next end Note: Step 3: Create a scheduled trigger to reboot the cluster every Sunday.
config system automation-trigger edit "RebootFGTeverySunday" set trigger-type scheduled set trigger-frequency weekly set trigger-weekday sunday set trigger-hour 11 next end
Step 4: Create two automation stitches for each primary and secondary device.
config system automation-stitch edit "RebootPrimary" set trigger "RebootFGTeverySunday" config actions edit 1 set action "RebootFGTCLI" set required enable next end set destination "rebootPrimary" next edit "RebootSecondary" set trigger "RebootFGTeverySunday" config actions edit 1 set action "RebootFGTCLI" set required enable next end set destination "rebootSeconday" next end
When the script executes, both of the devices will reboot at the same time. As a result, fine-tuning the trigger-hours is useful to avoid losing all connections at the same time. Different automation-triggers can be applied to each cluster device.
Config system automation destination: FortiGate CLI reference |