[Nokia-IXR7250E] Modify the platform_reboot on the IXR7250E for PMON API reboot and Disable all SFPs (#17483)

Why I did it
When Supervisor card is rebooted by using PMON API, it takes about 90 seconds to trigger the shutdown in down path. At this time linecards have been up. This delays linecards database initialization which is trying to PING/PONG the database-chassis. To address this issue, we modified the NDK to use the system call with "sudo reboot" when the request is from PMON API on Supervisor case. The NDK version is 22.9.20 and greater. This new NDK requires this modifcaiton of platform_reboot to work with.

Work item tracking
Microsoft ADO (number only): 26365734
How I did it
Modify the platform_reboot In Supervisor not to reboot all IMMs since it has been done in the function reboot() in module.py. Also handle the reboot-cause.txt for on the Supervisor when the reboot is request from PMON API.
Modify the Nokia platform specific platform_reboot in linecard to disable all SPFs.
This PR works with NDK version 22.9.20 and above

Signed-off-by: mlok <marty.lok@nokia.com>
This commit is contained in:
Marty Y. Lok 2024-01-08 14:39:30 -05:00 committed by GitHub
parent 98f24b639e
commit a5d443d60a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 5 deletions

View File

@ -17,6 +17,10 @@ update_reboot_cause()
sync
}
echo "Disable all SFPs"
python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.tx_disable_all_sfps()'
sleep 3
# update the reboot_cuase file when reboot is trigger by device-mgr
update_reboot_cause

View File

@ -1,15 +1,39 @@
#!/bin/bash
echo "Rebooting all Linecards"
python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.reboot_imms()'
sleep 3
DEVICE_MGR_REBOOT_FILE="/tmp/device_mgr_reboot"
update_reboot_cause()
{
DEVICE_MGR_REBOOT_FILE=/tmp/device_mgr_reboot
REBOOT_CAUSE_FILE=/host/reboot-cause/reboot-cause.txt
DEVICE_REBOOT_CAUSE_FILE=/etc/opt/srlinux/reboot-cause.txt
if [ -e $DEVICE_MGR_REBOOT_FILE ]; then
if [ -e $DEVICE_REBOOT_CAUSE_FILE ]; then
cp -f $DEVICE_REBOOT_CAUSE_FILE $REBOOT_CAUSE_FILE
fi
rm -f $DEVICE_MGR_REBOOT_FILE
else
touch /etc/opt/srlinux/devmgr_reboot_cause.done
rm -f $DEVICE_REBOOT_CAUSE_FILE &> /dev/null
fi
sync
}
if [ ! -e $DEVICE_MGR_REBOOT_FILE ]; then
echo "Rebooting all Linecards"
python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.reboot_imms()'
sleep 3
fi
# update the reboot_cuase file when reboot is trigger by device-mgr
update_reboot_cause
systemctl stop nokia-watchdog.service
sleep 2
echo "w" > /dev/watchdog
kick_date=`date -u`
echo "last watchdog kick $kick_date" > /var/log/nokia-watchdog-last.log
rm -f /sys/firmware/efi/efivars/dump-*
touch /etc/opt/srlinux/devmgr_reboot_cause.done
rm -f /etc/opt/srlinux/reboot-cause.txt
echo "Shutdown midplane"
ifconfig xe0 down
sync