Repository navigation
F #-: VRouter: VRRP: Hooks on role-changes - #415
Open
netaviator wants to merge 2 commits into
Open
netaviator wants to merge 2 commits into
netaviator wants to merge 2 commits into
Conversation
netaviator
added a commit
to netaviator/one-apps
that referenced
this pull request
Oct 20, 2026
The hooks are in PR OpenNebula#415. Also name the test image as a Docker image. Signed-off-by: Jan Gilla <jgilla@level66.network>
netaviator
added a commit
to netaviator/one-apps
that referenced
this pull request
Oct 20, 2026
The hooks are in PR OpenNebula#415. Also name the test image as a Docker image. Signed-off-by: Jan Gilla <jgilla@level66.network>
Run the executables in /etc/one-appliance/ha-hooks.d/ in name order with "up" (the node became MASTER) or "down" (it became BACKUP) once the stock failover services have been switched. Other services (a routing daemon, for example) can follow the VRRP role without patching the Failover module. A hook never breaks the failover: every failure is only logged. Each hook runs synchronously but bounded: its output goes to a file (not a pipe, so leftover children cannot block the failover) and a hook past 30s is killed together with its whole process group. Add the first unit tests for the Failover module (event handling and the hooks: order, arguments, non-executable files, failing, hanging and raising hooks). Signed-off-by: Jan Gilla <jgilla@level66.network>
Describe what the service does on a role change and the contract of the hooks in ha-hooks.d: arguments, order, environment, time limit, failure handling and that a hook has to be safe to run twice. Signed-off-by: Jan Gilla <jgilla@level66.network>
netaviator
force-pushed
the
pr/vrouter-failover-hooks
branch
from
October 20, 2026 21:50
277e0f2 to
7658ce6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run the executables in /etc/one-appliance/ha-hooks.d/ in name order with "up" (the node became MASTER) or "down" (it became BACKUP).
Services that have to follow the VRRP role currently need a patch to the Failover module. Two examples: a routing daemon that makes the standby less attractive to its peers (a longer AS path or a higher metric) and undoes that on the master, and a connection-tracking sync daemon that asks its peer for a full resync on the standby. With hooks, such a service ships its own executable and the Failover module stays unchanged.
"up" hooks run after the stock services have been restarted, so forwarding does not wait for them. "down" hooks run first, before the stock services are stopped. "up" hooks see the VM context in their environment; "down" hooks do not and read it themselves if they need it.
A hook never breaks the failover: every failure is only logged. Each hook runs synchronously but bounded: its output goes to a file (not a pipe, so leftover children cannot block the failover), and a hook past 30s is killed together with its whole process group. Hooks run one after the other, so the worst case is the number of hooks times 30s.