Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for MCLAG #453

Merged
merged 7 commits into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,16 @@ def _stop_services():
log_error("Stopping {} failed with error {}".format(service, e))
raise

# iccpd service doesn't start by default
(out, err) = run_command("systemctl status iccpd", return_output = True)
jleveque marked this conversation as resolved.
Show resolved Hide resolved
if not err and 'Active: active (running)' in out:
try:
click.echo("Stopping service iccpd ...")
run_command("systemctl stop iccpd")
except SystemExit as e:
log_error("Stopping iccpd failed with error {}".format(e))
raise

def _reset_failed_services():
services_to_reset = [
'bgp',
Expand All @@ -357,6 +367,16 @@ def _reset_failed_services():
log_error("Failed to reset failed status for service {}".format(service))
raise

# iccpd service doesn't start by default
(out, err) = run_command("systemctl is-enabled iccpd", return_output = True)
if not err and 'enabled' in out:
try:
click.echo("Resetting failed status for service iccpd ...")
run_command("systemctl reset-failed iccpd")
except SystemExit as e:
log_error("Failed to reset failed status for service iccpd")
raise

def _restart_services():
services_to_restart = [
'hostname-config',
Expand All @@ -378,6 +398,16 @@ def _restart_services():
log_error("Restart {} failed with error {}".format(service, e))
raise

# iccpd service doesn't start by default
(out, err) = run_command("systemctl is-enabled iccpd", return_output = True)
if not err and 'enabled' in out:
try:
click.echo("Restarting service iccpd ...")
run_command("systemctl restart iccpd")
except SystemExit as e:
log_error("Restart iccpd failed with error {}".format(e))
raise

def is_ipaddress(val):
""" Validate if an entry is a valid IP """
if not val:
Expand Down
18 changes: 18 additions & 0 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,24 @@ debug "Stopped bgp ..."
docker kill lldp > /dev/null
systemctl stop lldp

if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
if echo $(docker ps) | grep -q iccpd; then
docker kill iccpd > /dev/null || [ $? == 1 ]
fi
fi

# Stop iccpd gracefully
if [[ "$REBOOT_TYPE" = "warm-reboot" || "$REBOOT_TYPE" = "fastfast-reboot" ]]; then
if echo $(docker ps) | grep -q iccpd; then
debug "Stopping iccpd ..."
# Send USR1 signal to iccpd to stop it
# It will prepare iccpd for warm-reboot
# Note: We must send USR1 signal before syncd, or some state of iccpd maybe lost
docker exec -i iccpd pkill -USR1 iccpd || [ $? == 1 ] > /dev/null
debug "Stopped iccpd ..."
fi
fi

if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
# Kill teamd processes inside of teamd container with SIGUSR2 to allow them to send last LACP frames
# We call `docker kill teamd` to ensure the container stops as quickly as possible,
Expand Down