MitchDrage opened a new pull request, #14841: URL: https://github.com/apache/cloudstack/pull/14841
### Description When a BGP peer changes, the virtual router restarts FRR, which drops every BGP session on the router. This PR applies the change with `frr-reload.py`, so only the changed neighbours are touched. It prepares the router for #14687. - `CsBgpPeers` reloads FRR once bgpd is running. It restarts FRR only to start bgpd, or when `frr-reload.py` is missing or fails. The rendered file states the FRR version, `ebgp-requires-policy`, `network import-check` and the forwarding lines, so a reload never changes them. - New global setting `vpc.gateway.bgp.min.holdtime` (default 3) renders `bgp minimum-holdtime`, which applies to every peer on the router. BGP allows a hold time of 0 or 3 and up, so the default refuses only peers that turn keepalives off with hold time 0. Setting it to 0 turns the minimum off. Values outside 0-65535 are refused when the setting is saved. - Router diagnostics gain the FRR log and a copy of `frr.conf` with peer passwords masked. The router version health check prints which FRR tools the template has, for later use by #14687. - The systemvm template installs `frr-pythontools`, which ships `frr-reload.py`. Please note, this needs a new systemvm template with `frr-pythontools` installed. Routers on an older template will continue to restart FRR, which affects all peers at once when one neighbour changes. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] build/CI - [ ] test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [x] Minor ### Screenshots (if appropriate): N/A ### How Has This Been Tested? - New unit tests: `TestCsBgpPeersFrr`, `TestRouterVersionCheck`, `SetBgpPeersMinHoldtimeTest`, `CommandSetupHelperBgpPeersMinHoldtimeTest`, `DiagnosticsFilesListFrrTest` and `TenantBgpConfigFloorTest`. `TestCsBgpPeers` and its fixture are updated for the new lines, and `ConfigurationManagerImplTest` covers the setting's range. - On a KVM ROUTED VPC with Dynamic routing (4.22.1.1 management server, these router scripts, `frr-pythontools` installed), adding and then removing a second peer went through `frr-reload.py`. bgpd's pid stayed the same and the first peer's session stayed up. On the stock router the same change restarted bgpd and reset the session. - Without `frr-pythontools` the router restarted FRR and applied the new file. The router version health check showed `frrreload=yes bfdd=yes frrmajor=8`, and the masked copy hid the peer password. - On a 4.22.1.1 KVM lab with these changes, the hold-time setting reached the router end to end. With the minimum at 3, a peer asking for hold time 0 was refused with Unacceptable Hold Time. Set to 0, the `bgp minimum-holdtime` line disappeared and the session came up. After a router stop and start, peer changes still went through `frr-reload.py`. - The server, core and engine-schema tests and checkstyle pass. #### How did you try to break this feature and the system with this change? - Removed `frr-reload.py`, or made it fail: the router falls back to a restart and still applies the config. - Configured the first peer on a router with bgpd off: FRR restarts to start bgpd. - Set the minimum hold time to 0: no `bgp minimum-holdtime` line is rendered, since FRR accepts only 1-65535 there. Values outside 0-65535 are refused. - Used a peer password with a line break: the diagnostics copy masks all of it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
