fix(ipsec): guard ipsec_encapsulation on ovs-monitor-ipsec liveness

enableOVNIPSec set OVS cert pointers + ipsec_encapsulation=true without
ensuring ovs-monitor-ipsec.service was running. Without that daemon, OVS
holds the cert pointers unused, strongSwan never gets IKE config, and
tunnel traffic ovn-controller marks for encryption gets silently
dropped. TestMultinodeIPSec fails on `node1 xfrm has no AEAD SAs`.

- systemd: spinifex-daemon Wants=/After= ovs-monitor-ipsec.service
- daemon: ensureOVSMonitorIPSecActive — systemctl enable --now +
  is-active poll; refuses to flip ipsec_encapsulation if daemon is dead
- daemon: single-node short-circuit — no peers means no tunnels means
  the flag is at best inert and at worst load-bearing-silent-drop
- ci: capture-net-diag.sh + workflow steps to snapshot OVS/OVN/xfrm
  state on failure, fan out across all 3 multinode nodes

Refs: mulga-siv-136
This commit is contained in:
joshsiv-mulga
2026-05-25 10:16:01 +10:00
parent e7bbc64a45
commit 596e787bd0
5 changed files with 270 additions and 24 deletions
+55
View File
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
# capture-net-diag.sh — write a snapshot of network / OVN / OVS / IPsec
# state into $1 (a directory the caller already created on the local host).
# Designed to run on a spinifex node after an E2E suite, before tofu destroy
# pulls the rug out. Every command is independent — `|| true` so a missing
# binary on one path doesn't abort the rest of the capture.
#
# Output layout (under $1/net-diag/):
# ovs-monitor-ipsec.status systemctl status (output-only)
# ovs-monitor-ipsec.journal last 200 journal lines
# ipsec.openvswitch_conf ovs-vsctl get Open_vSwitch . other_config
# ipsec.xfrm_state ip xfrm state list
# ipsec.xfrm_policy ip xfrm policy list
# ovn.sb_show ovn-sbctl show
# ovn.nb_show ovn-nbctl show
# ovs.show ovs-vsctl show
# ovs.flows_br_int ovs-ofctl dump-flows br-int
# ovs.tunnels ovs-appctl ofproto/list-tunnels br-int
# net.links ip -s link show
# net.routes ip route show table all
# net.addrs ip -br addr show
# systemd.failed_units systemctl list-units --state=failed
set +e
OUT="${1:?usage: capture-net-diag.sh <output-dir>}"
mkdir -p "$OUT"
run() {
local label="$1"; shift
{
echo "# $*"
"$@" 2>&1
} > "$OUT/$label" || true
}
run ovs-monitor-ipsec.status sudo systemctl status ovs-monitor-ipsec.service --no-pager --full --lines=50
run ovs-monitor-ipsec.journal sudo journalctl -u ovs-monitor-ipsec.service --no-pager --output=short-iso -n 200
run ipsec.openvswitch_conf sudo ovs-vsctl get Open_vSwitch . other_config
run ipsec.xfrm_state sudo ip xfrm state list
run ipsec.xfrm_policy sudo ip xfrm policy list
run ovn.sb_show sudo ovn-sbctl show
run ovn.nb_show sudo ovn-nbctl show
run ovn.sb_chassis sudo ovn-sbctl list chassis
run ovs.show sudo ovs-vsctl show
run ovs.flows_br_int sudo ovs-ofctl dump-flows br-int
run ovs.tunnels sudo ovs-appctl ofproto/list-tunnels br-int
run net.links ip -s link show
run net.routes ip route show table all
run net.addrs ip -br addr show
run systemd.failed_units sudo systemctl list-units --state=failed --no-pager
exit 0