Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
86416d2
ip_conntrack: include allowed_address_pairs in CT_MARK_INVALID cleanup
pulchart Sep 10, 2025
0880e87
Remove NEUTRON_DEPLOY_MOD_WSGI from zuul jobs
brianphaley Apr 24, 2026
2409a03
[CI] Move CentOS jobs to 10-stream
karelyatin Sep 15, 2025
bf41c54
Add dns forwarder l2 extension
daikk115 May 30, 2025
782b07d
Change ovn_router_indirect_snat config option to True
brianphaley May 4, 2026
1443008
Remove setting of enforce_scope in unit tests
brianphaley Apr 30, 2026
7bbadcb
Fix issues in _check_router_interface_not_in_use()
brianphaley Jun 2, 2026
d10035d
ovn: pass gateway LRPs to _check_external_ips_changed
ralonsoh Jun 3, 2026
26c1405
ovn: avoid nested transaction in ``_delete_port`` virtual parent check
ralonsoh Jun 3, 2026
637444b
ovn: read LSP ``up`` state from IDL cache in ``update_lsp_host_info``
ralonsoh Jun 4, 2026
d2732d3
Add generic RangeAllocator and VNI/VLAN allocation
otherwiseguy May 29, 2026
c695003
Use idl.has_lock instead of idl.is_lock_contended for OVSDB lock checks
ralonsoh Jun 3, 2026
7a70217
[OVN] Fix race condition during floating ip deletion
felixmoebius May 7, 2026
b50aa85
Validate [DEFAULT] setproctitle while loading config files
kajinamit Jun 4, 2026
342bca3
Add a neutron dependency change detection tool
otherwiseguy Jun 7, 2026
db196cf
Fix Update response after updating PVLAN properties
elvgarrui Jun 3, 2026
f0aad94
Use policy check strings from neutron-lib
slawqo Jun 8, 2026
2232cd1
epvn: Split Svd into generic and Evpn specific
cubeek Jun 5, 2026
022c7bd
Remove contrib module from neutron.tests
slawqo Jun 8, 2026
2064a39
Enable PVLAN service plugin in DevStack
fyanac Jun 8, 2026
25c8c8f
evpn: Implement OVN portion
cubeek May 21, 2026
1bce68e
Merge "Validate [DEFAULT] setproctitle while loading config files"
Jun 8, 2026
8b636c7
Merge "Remove contrib module from neutron.tests"
Jun 8, 2026
b54f664
doc: Add missing zero quota information in subnetpools
winiciusallan Jun 8, 2026
6d43aab
Integrated SVD into OVN Agent EVPN Extension
Jun 2, 2026
d8eb719
evpn: Pass VLAN ID in port binding events to FSM
otherwiseguy Jun 4, 2026
4bb1a29
FRR driver for a EVPN router
mtomaska Apr 30, 2026
012c9e6
Frr should write running config to memory to persist reboots
mtomaska Jun 3, 2026
c50ec76
Merge "Add dns forwarder l2 extension"
Jun 9, 2026
e0959b4
Merge "Enable PVLAN service plugin in DevStack"
Jun 9, 2026
06aaa4c
quota: Fix quota details API error with unloaded service plugins
ralonsoh Jun 8, 2026
b7ef8bb
Merge "Add generic RangeAllocator and VNI/VLAN allocation"
Jun 9, 2026
ed7a151
Merge "evpn: Implement OVN portion"
Jun 9, 2026
8a4a4b1
ovs: skip OF operations for ports with invalid ofport
ralonsoh Jun 9, 2026
16fadc5
Remove the unused ``api_workers`` config knob
ralonsoh Jun 8, 2026
8ccf3f9
Fix ``update_router:enable_default_route_*`` policies
ralonsoh Jun 9, 2026
2a2f92e
Merge "Use policy check strings from neutron-lib"
Jun 9, 2026
9a0829f
Merge "ovn: read LSP ``up`` state from IDL cache in ``update_lsp_host…
Jun 9, 2026
8ca5a1d
Merge "doc: Add missing zero quota information in subnetpools"
Jun 9, 2026
1035806
BGP job: move to experimental pipeline
eduolivares Jun 9, 2026
f379dea
evpn: Set HA chassis group on EVPN LRP
cubeek Jun 9, 2026
911b213
Merge "ovs: skip OF operations for ports with invalid ofport"
Jun 9, 2026
c1c73ca
Merge "epvn: Split Svd into generic and Evpn specific"
Jun 9, 2026
5a04b57
Merge "Integrated SVD into OVN Agent EVPN Extension"
Jun 9, 2026
4459661
evpn: Remove EVPN_VRF_NAME_LEN constant
cubeek Jun 9, 2026
d8beced
Merge "BGP job: move to experimental pipeline"
Jun 9, 2026
1fc95d9
Add RandomRangeAllocator for random VNI selection
otherwiseguy Jun 3, 2026
5e2cda2
Merge "FRR driver for a EVPN router"
Jun 9, 2026
905d7eb
Merge "Frr should write running config to memory to persist reboots"
Jun 9, 2026
8fc35a1
Merge "evpn: Pass VLAN ID in port binding events to FSM"
Jun 10, 2026
276b69e
Merge "Use idl.has_lock instead of idl.is_lock_contended for OVSDB lo…
Jun 10, 2026
e5d06f7
Merge "quota: Fix quota details API error with unloaded service plugins"
Jun 10, 2026
ae7e7b5
Switch from setting LSP.tag to LSP.tag_request
otherwiseguy Jun 7, 2026
83f1d83
Ensure MaintenanceWorker lock set before connect
otherwiseguy Jun 9, 2026
8f1f4b8
Merge "evpn: Remove EVPN_VRF_NAME_LEN constant"
Jun 10, 2026
b252d4a
[functional tests] Handle frrinit.sh path for CentOS
karelyatin Jun 10, 2026
7f986bb
Integrate FrrDriver into OVN Agent EVPN Extension
mtomaska Jun 8, 2026
8836289
doc: Document runtime ``uwsgi`` Python module in WSGI guide
ralonsoh Jun 10, 2026
101b07c
Merge "Fix ``update_router:enable_default_route_*`` policies"
Jun 10, 2026
7ebcce0
ovs: defer ports with invalid ofport in ``_process_port``
ralonsoh Jun 10, 2026
13b62f4
Add PVLAN extension policy rules
elvgarrui Jun 9, 2026
a43b9a1
Merge "Integrate FrrDriver into OVN Agent EVPN Extension"
Jun 10, 2026
983a612
Merge "[functional tests] Handle frrinit.sh path for CentOS"
Jun 10, 2026
5c3ada6
Merge "Ensure MaintenanceWorker lock set before connect"
Jun 10, 2026
43d5034
Merge "Fix Update response after updating PVLAN properties"
Jun 10, 2026
91ac758
Merge "evpn: Set HA chassis group on EVPN LRP"
Jun 10, 2026
1427e59
Merge "doc: Document runtime ``uwsgi`` Python module in WSGI guide"
Jun 10, 2026
b3fc9cf
Merge "Switch from setting LSP.tag to LSP.tag_request"
Jun 10, 2026
e1cb410
Merge "ovs: defer ports with invalid ofport in ``_process_port``"
Jun 10, 2026
b1e698a
Merge "Add RandomRangeAllocator for random VNI selection"
Jun 10, 2026
aee9ca0
Merge "Add PVLAN extension policy rules"
Jun 11, 2026
56f707b
Merge "ovn: avoid nested transaction in ``_delete_port`` virtual pare…
Jun 11, 2026
de087e8
Merge "ovn: pass gateway LRPs to _check_external_ips_changed"
Jun 11, 2026
6ffe505
policy: remove ``OwnershipValidationHook``, update ``create_port`` rule
ralonsoh Jun 11, 2026
c40909a
Bump os-ken to 4.2.1 version
ralonsoh Jun 12, 2026
5d598cf
pecan: Optimize ``_exclude_attributes_by_policy`` on list responses
ralonsoh Jun 12, 2026
b2f6cb8
l3: Remove unused ``ha_keepalived_state_change_server_threads`` confi…
ralonsoh Jun 12, 2026
25a7c59
Remove UnknownNetworkType InvalidAddressRequest and IPAllocationFailed
ralonsoh Jun 12, 2026
75b6c30
Fix EVPN Port_Binding events
otherwiseguy Jun 12, 2026
a8feb94
More tag_request fixes
otherwiseguy Jun 12, 2026
129e88e
Explicitly create log directories in the FrrFixture
mtomaska Jun 13, 2026
cea1a8a
Frrinit.sh scripts spawns background deamons
mtomaska Jun 11, 2026
92181b3
Guard tun_br in _restore_local_vlan_map when no br-tun
xtrusia Jun 12, 2026
fa408cd
doc: fix RST formatting in ``modify_fields_to_db`` and ``modify_field…
ralonsoh Jun 15, 2026
7e68631
Rootwrap filters for vtysh
mtomaska Jun 13, 2026
b4c1144
Call static method ``RangeAllocator._make_params``
ralonsoh Jun 15, 2026
c6a821a
Merge "pecan: Optimize ``_exclude_attributes_by_policy`` on list resp…
Jun 15, 2026
6dce3c9
Merge "policy: remove ``OwnershipValidationHook``, update ``create_po…
Jun 15, 2026
9ffb4ca
Merge "More tag_request fixes"
Jun 15, 2026
897c920
Merge "l3: Remove unused ``ha_keepalived_state_change_server_threads`…
Jun 15, 2026
d8de4a7
Merge "Call static method ``RangeAllocator._make_params``"
Jun 15, 2026
07c07d9
Skip test for vrf delete on Centos9 with frr 8.5
mtomaska Jun 13, 2026
b877e9b
Fix superfluous-parens pylint warnings
brianphaley Jun 16, 2026
80f9f68
Merge "Guard tun_br in _restore_local_vlan_map when no br-tun"
Jun 16, 2026
73bf712
Merge "Skip test for vrf delete on Centos9 with frr 8.5"
Jun 16, 2026
6cad80b
Merge "[OVN] Fix race condition during floating ip deletion"
Jun 16, 2026
0634d28
Merge "Bump os-ken to 4.2.1 version"
Jun 16, 2026
82c4be6
Merge "Add a neutron dependency change detection tool"
Jun 16, 2026
ad15787
Re-install extension flows lost during ovs restart
rubasov Apr 9, 2026
2467144
Merge "Fix issues in _check_router_interface_not_in_use()"
Jun 16, 2026
f3368a5
Merge "ip_conntrack: include allowed_address_pairs in CT_MARK_INVALID…
Jun 16, 2026
8223b24
Merge "Remove NEUTRON_DEPLOY_MOD_WSGI from zuul jobs"
Jun 16, 2026
0b8c424
Drop redundant validation of ha_vrrp_auth_password
kajinamit Jul 2, 2025
9f92812
Merge "Fix EVPN Port_Binding events"
Jun 16, 2026
e528d8b
Remove the OVN Metadata agent grenade and n-t-p CI jobs
ralonsoh Jun 16, 2026
f95e8ce
Remove unused CI job definitions
ralonsoh Jun 16, 2026
4355bb2
Merge "Rootwrap filters for vtysh"
Jun 16, 2026
84a79cf
Merge "Remove the unused ``api_workers`` config knob"
Jun 16, 2026
b4d3fe6
Merge "Fix superfluous-parens pylint warnings"
Jun 16, 2026
5c095ee
Merge "Drop redundant validation of ha_vrrp_auth_password"
Jun 16, 2026
fa2b68d
Add configurable HAProxy timeouts for metadata proxy
rm-you May 29, 2026
35ce788
Merge "Remove UnknownNetworkType InvalidAddressRequest and IPAllocati…
Jun 17, 2026
319761f
Merge "Explicitly create log directories in the FrrFixture"
Jun 17, 2026
718434b
Fix unnecessary-pass pylint warnings
brianphaley Jun 16, 2026
d70bdc9
[metadata] cleanup response headers
pshchelo Dec 11, 2025
425f97d
FrrDriver Vtysh accepts --vty_socket argument
mtomaska Jun 15, 2026
91abb5e
Only set the maintenance worker lock on the worker
otherwiseguy Jun 17, 2026
b2e5bdd
Merge "Remove the OVN Metadata agent grenade and n-t-p CI jobs"
Jun 18, 2026
73969ab
Merge "Remove unused CI job definitions"
Jun 18, 2026
a8856b7
Add security-groups-default-statefulness API extension
ralonsoh Apr 12, 2026
e1799a3
Implement router_route quota using the Neutron quota engine
ralonsoh Jun 2, 2026
0a2042c
Merge "doc: fix RST formatting in ``modify_fields_to_db`` and ``modif…
Jun 18, 2026
953495b
Delete ``FloatingIPDNS`` row on FIP disassociation
ralonsoh Jun 18, 2026
a6c4f5e
Merge "Only set the maintenance worker lock on the worker"
Jun 18, 2026
4f23dbf
Merge "FrrDriver Vtysh accepts --vty_socket argument"
Jun 18, 2026
8b5e6f1
Replace keepalived-state-change by a dash script
thomasgoirand May 12, 2026
cc31dc5
Merge "Add security-groups-default-statefulness API extension"
Jun 18, 2026
83d71da
Merge "Remove setting of enforce_scope in unit tests"
Jun 19, 2026
53f099e
Merge "[metadata] cleanup response headers"
Jun 19, 2026
7c6b99e
Merge "Re-install extension flows lost during ovs restart"
Jun 19, 2026
f1a6d73
Merge "Delete ``FloatingIPDNS`` row on FIP disassociation"
Jun 19, 2026
b999e59
Fix too-many-nested-blocks pylint warnings
brianphaley Jun 21, 2026
70e67ba
Merge "Fix unnecessary-pass pylint warnings"
Jun 22, 2026
9053817
Merge "Change ovn_router_indirect_snat config option to True"
Jun 22, 2026
4aabb3e
Increase ``allowed_network_downtime`` to 7.0
ralonsoh Jun 22, 2026
adbaca7
Merge "Fix too-many-nested-blocks pylint warnings"
Jun 22, 2026
869fb25
Merge "[CI] Move CentOS jobs to 10-stream"
Jun 22, 2026
5c6cd0d
Revert "Skip test for vrf delete on Centos9 with frr 8.5"
mtomaska Jun 22, 2026
00d660c
Merge "Implement router_route quota using the Neutron quota engine"
Jun 23, 2026
bc55b63
Fix consider-using-enumerate pylint warnings
brianphaley Jun 21, 2026
f810c92
Remove missing ``max_routes`` option in testing
ralonsoh Jun 23, 2026
5dc8ff6
Merge "Revert "Skip test for vrf delete on Centos9 with frr 8.5""
Jun 23, 2026
93b58bc
Merge "Increase ``allowed_network_downtime`` to 7.0"
Jun 23, 2026
9b3d152
Merge "Replace keepalived-state-change by a dash script"
Jun 23, 2026
73e8e10
Merge "Fix consider-using-enumerate pylint warnings"
Jun 23, 2026
a0d038f
Merge "Remove missing ``max_routes`` option in testing"
Jun 23, 2026
534c649
ovn_client: Reset only defined LRP.options
cubeek Jun 22, 2026
0b3798e
evpn: delete EVPN HA Chassis Group on router deletion
ralonsoh Jun 15, 2026
a801343
Retry when NetlinkDumpInterrupted exception
Jun 22, 2026
3f8cc57
Fix consider-iterating-dictionary pylint warnings
brianphaley Jun 23, 2026
dd2d06c
Merge "evpn: delete EVPN HA Chassis Group on router deletion"
Jun 24, 2026
fcea0af
Merge "ovn_client: Reset only defined LRP.options"
Jun 24, 2026
454df36
Fix PVLAN multinode support
elvgarrui Jun 18, 2026
1e476b8
evpn: Add priority to EVPN callbacks
cubeek Jun 24, 2026
2464943
ovn: Handle missing ``neutron:network_name`` in sibling LRPs
ralonsoh Jun 16, 2026
1cab59d
Merge "Add configurable HAProxy timeouts for metadata proxy"
Jun 24, 2026
2856ae5
segments: Catch RP not found in ``_delete_nova_inventory``
ralonsoh Jun 18, 2026
a29365d
Merge "Fix PVLAN multinode support"
Jun 24, 2026
4141340
Merge "Fix consider-iterating-dictionary pylint warnings"
Jun 25, 2026
c372acd
Merge "segments: Catch RP not found in ``_delete_nova_inventory``"
Jun 25, 2026
958d734
tests: Fix random failure in ``test_router_update_with_too_many_routes``
ralonsoh Jun 25, 2026
323d05e
Merge "tests: Fix random failure in ``test_router_update_with_too_man…
Jun 26, 2026
3c1c8c3
Merge "evpn: Add priority to EVPN callbacks"
Jun 26, 2026
d0442f1
Merge "ovn: Handle missing ``neutron:network_name`` in sibling LRPs"
Jun 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 0 additions & 9 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ suggestion-mode=yes
# with a local disable)
disable=
# "F" Fatal errors that prevent further processing
import-error,
# "I" Informational noise
# "E" Error for important programming issues (likely bugs)
access-member-before-definition,
Expand All @@ -67,27 +66,20 @@ disable=
redefined-outer-name,
signature-differs,
super-init-not-called,
unpacking-non-sequence,
unused-argument,
unused-import,
unused-variable,
unnecessary-pass,
raise-missing-from,
arguments-renamed,
broad-exception-raised,
unspecified-encoding,
unused-private-member,
# "C" Coding convention violations
consider-iterating-dictionary,
consider-using-enumerate,
invalid-name,
missing-docstring,
singleton-comparison,
superfluous-parens,
ungrouped-imports,
wrong-import-order,
consider-using-f-string,
consider-using-dict-items,
# "R" Refactor recommendations
duplicate-code,
inconsistent-return-statements,
Expand All @@ -100,7 +92,6 @@ disable=
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-positional-arguments,
too-many-public-methods,
too-many-return-statements,
Expand Down
305 changes: 305 additions & 0 deletions bin/neutron-keepalived-state-change
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
#!/bin/sh
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# Note from zigo: this script was in Python, and took 100MB of RAM, which
# may be a way too much if running with a lot of virtual routers.
#
# We've switched it to /bin/sh, so in Debian/Ubuntu, this is dash by default,
# which is 3 or 4MB of RAM, compared to about 12MB with bash as of writing.
# Bash is also a way slower to spawn. All together, with a subshell and the
# "ip" command running, the grand total is less than 6MB for each instance
# of this script.
#
# Therefore, please do not introduce any bashism in this script, which
# basically means: no arrays, plus a more limited/strict syntax. Bashism can
# be checked for with checkbashisms from the devscripts package.

set -e

write_log () {
local level message
level=${1}
message=${2}
timestamp=$(date '+%Y-%m-%d %H:%M:%S.%3N' | tr -d '\n')

if [ "${DEBUG}" = "yes" ] || [ "${level}" = "INFO" ] || [ "${level}" = "ERROR" ]; then
if [ -n "${ROUTER_ID}" ]; then
msg="${timestamp} ${level} $$ ${ROUTER_ID}: ${message}"
else
msg="${timestamp} ${level} $$ ${message}"
fi
if [ -n "${LOG_FILE}" ]; then
printf "%s\n" "${msg}" >> "${LOG_FILE}"
else
printf "%s\n" "${msg}"
fi
fi
}


write_state_file () {
echo -n ${1} >"${CONF_DIR}/state"
write_log DEBUG "Wrote state ${1} to ${CONF_DIR}/state"
}


notify_agent () {
local state socket
state=${1}
socket="${STATE_PATH}/keepalived-state-change"

curl --connect-timeout 5 \
-X POST \
-H "X-Neutron-Router-Id: ${ROUTER_ID}" \
-H "X-Neutron-State: ${state}" \
-H "Connection: close" \
--unix-socket "${socket}" \
"http://127.0.0.1/"
write_log DEBUG "Notified agent of state ${state}"
}

cleanup() {
kill -TERM "$IP_MONITOR_PID" "$MONITOR_LOOP_PID" 2>/dev/null
sleep 1
kill -KILL "$IP_MONITOR_PID" "$MONITOR_LOOP_PID" 2>/dev/null
rm -f ${CONF_DIR}/ip-monitor
}

conntrackd_cmd () {
local option cmd
option=${1}

cmd="conntrackd -C ${CONF_DIR}/conntrackd.conf ${option}"

write_log DEBUG "Executing \"${cmd}\" on router ${ROUTER_ID}."

# Run in namespace, as root, don't fail on error (like Python's check_exit_code=False)
ip netns exec "${NAMESPACE}" ${cmd} 2>&1 || true
}

sync_conntrack () {
local state
state=${1}

if [ "${state}" = "primary" ]; then
# commit external cache to kernel
conntrackd_cmd -c
# flush internal & external caches
conntrackd_cmd -f
# resync internal cache to kernel
conntrackd_cmd -R
# send bulk update to backups
conntrackd_cmd -B
write_log DEBUG "Synced connection tracking state on primary for router ${ROUTER_ID}"
elif [ "${state}" = "backup" ]; then
# shorten timers, remove zombie entries
conntrackd_cmd -t
# request resync with primary
conntrackd_cmd -n
write_log DEBUG "Synced connection tracking state on backup for router ${ROUTER_ID}"
else
write_log ERROR "Unknown state \"${state}\"."
fi
}

monitor_ip_address () {
local is_init
is_init="True"

# Example output from "ip -o monitor address" when adding an IP to an interface:
# 678: qr-a1aa54e5-12 inet 10.4.39.1/24 scope global qr-a1aa54e5-12\ valid_lft forever preferred_lft forever
# Here's the output when removing the IP:
# Deleted 678: qr-a1aa54e5-12 inet 10.4.39.1/24 scope global qr-a1aa54e5-12\ valid_lft forever preferred_lft forever

# If there's a left over, the script would exit,
# so we MUST make sure the file isn't there.
if [ -e ${CONF_DIR}/ip-monitor ]; then
rm -f ${CONF_DIR}/ip-monitor
fi
mkfifo ${CONF_DIR}/ip-monitor

ip netns exec "${NAMESPACE}" ip -o monitor address > "${CONF_DIR}/ip-monitor" &
IP_MONITOR_PID=$!

while read event; do
if [ "${is_init}" = "True" ]; then
is_init="False"

if [ "${ENABLE_CONNTRACKD}" = "yes" ] ; then
sync_conntrack "${initial_state}"
fi

# NOTE: the initial state notification is done after the SIGTERM trap is
# set and the PID written in the file, in order to be able to finish this
# script whenever is needed.
notify_agent "${initial_state}"
fi

if [ -z "${event}" ]; then
# Empty event
continue
fi

event_word1=$(echo "$event" | awk '{print $1}')
if [ "${event_word1}" = "Deleted" ]; then
event_cidr=$(echo "${event}" | awk '{print $5}')
event_interface=$(echo "${event}" | awk '{print $3}')
state="backup"
else
event_cidr=$(echo "${event}" | awk '{print $4}')
event_interface=$(echo "${event}" | awk '{print $2}')
state="primary"
fi
event_interface=$(echo "${event_interface}" | cut -d'@' -f1)

if [ "${MONITOR_CIDR}" = "${event_cidr}" ] && [ "${MONITOR_INTERFACE}" = "${event_interface}" ]; then
write_log INFO "Detected state change to: ${state}"
write_state_file "${state}"
if [ "${ENABLE_CONNTRACKD}" = "yes" ] ; then
sync_conntrack "${state}"
fi
notify_agent "${state}"
fi
done < "${CONF_DIR}/ip-monitor" &
MONITOR_LOOP_PID=$!

trap cleanup INT TERM EXIT
wait "${IP_MONITOR_PID}"
}


handle_initial_state () {
if ip netns exec "${NAMESPACE}" ip -br address show dev "${MONITOR_INTERFACE}" | awk '{$1=$2=""; sub(/^ */, ""); print}' | tr ' ' '\n' | grep -Fxq -- "${MONITOR_CIDR}"; then
initial_state="primary"
else
write_log DEBUG "Device ${MONITOR_INTERFACE} not present in the namespace ${NAMESPACE} or ${MONITOR_CIDR} not set in device"
initial_state="backup"
fi

write_log INFO "Initial status of router is ${initial_state}"
write_state_file ${initial_state}
if [ "${ENABLE_CONNTRACKD}" = "yes" ] ; then
sync_conntrack ${initial_state}
fi
}


ENABLE_CONNTRACKD=no
DEBUG=no
for i in $@ ; do
case "${1}" in
"--router_id")
ROUTER_ID="${2}"
shift
shift
;;
"--namespace")
NAMESPACE="${2}"
shift
shift
;;
"--conf_dir")
CONF_DIR="${2}"
shift
shift
;;
"--log-file")
LOG_FILE="$2"
shift
shift
;;
"--monitor_interface")
MONITOR_INTERFACE="$2"
shift
shift
;;
"--monitor_cidr")
MONITOR_CIDR="${2}"
shift
shift
;;
"--pid_file")
PID_FILE="${2}"
shift
shift
;;
"--state_path")
STATE_PATH="${2}"
shift
shift
;;
"--user")
USER="${2}"
shift
shift
;;
"--group")
GROUP="${2}"
shift
shift
;;
"--enable_conntrackd")
ENABLE_CONNTRACKD=yes
shift
;;
"--debug")
DEBUG=yes
shift
;;
*)
;;
esac
done

if [ -z "${LOG_FILE}" ]; then
LOG_FILE="/var/log/neutron/neutron-keepalived-state-change.log"
fi

if [ -z "${ROUTER_ID}" ]; then
write_log ERROR "Missing --router_id parameter: exiting."
exit 1
fi

if [ -z "${NAMESPACE}" ];then
write_log ERROR "No namespace: exiting."
exit 1
fi

if [ -z "${MONITOR_INTERFACE}" ];then
write_log ERROR "No monitor interface: exiting."
exit 1
fi

if [ -z "${MONITOR_CIDR}" ];then
write_log ERROR "No monitor CIDR: exiting."
exit 1
fi

if ! [ -d "${CONF_DIR}" ];then
write_log ERROR "No configuration directory to write in."
exit 1
fi

if [ -z "${PID_FILE}" ];then
write_log ERROR "No PID file: exiting."
exit 1
fi

# Write our PID file:
PARENT_PID=$(ps -o pgid= $$ | tr -d ' ')
echo -n $$ >${PID_FILE}
write_log DEBUG "Writing child PID $$ for SIGTERM"

initial_state="backup"
handle_initial_state
monitor_ip_address
42 changes: 42 additions & 0 deletions devstack/etc/frr_with_evpn/daemons
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
bgpd=yes
ospfd=no
ospf6d=no
ripd=no
ripngd=no
isisd=no
pimd=no
ldpd=no
nhrpd=no
eigrpd=no
babeld=no
sharpd=no
pbrd=no
bfdd=no
fabricd=no
vrrpd=no
pathd=no

#
# If this option is set the /etc/init.d/frr script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/frr if you intend to use "vtysh"!
#
vtysh_enable=yes
zebra_options=" -A 127.0.0.1 -s 90000000"
bgpd_options=" -A 127.0.0.1"
ospfd_options=" -A 127.0.0.1"
ospf6d_options=" -A ::1"
ripd_options=" -A 127.0.0.1"
ripngd_options=" -A ::1"
isisd_options=" -A 127.0.0.1"
pimd_options=" -A 127.0.0.1"
ldpd_options=" -A 127.0.0.1"
nhrpd_options=" -A 127.0.0.1"
eigrpd_options=" -A 127.0.0.1"
babeld_options=" -A 127.0.0.1"
sharpd_options=" -A 127.0.0.1"
pbrd_options=" -A 127.0.0.1"
staticd_options="-A 127.0.0.1"
bfdd_options=" -A 127.0.0.1"
fabricd_options="-A 127.0.0.1"
vrrpd_options=" -A 127.0.0.1"
4 changes: 4 additions & 0 deletions devstack/etc/frr_with_evpn/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
frr defaults traditional
hostname devstack
log file /var/log/frr/frr.log informational
log timestamp precision 3
Loading