Skip to content

Commit

Permalink
[201911] DellEMC S6100 SSD Monitor additional changes (sonic-net#7291)
Browse files Browse the repository at this point in the history
Why I did it
Added soft-reboot plugin support.
Added SSD version s16425cq check
Added error message to display in console/SSH in case reboot is called in faulty/non-upgraded devices.
  • Loading branch information
santhosh-kt committed May 4, 2021
1 parent 39e978b commit 6204a1d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ s6100/scripts/platform_reboot_override usr/share/sonic/device/x86_64-dell_s6100_
s6100/scripts/fast-reboot_plugin usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
s6100/scripts/track_reboot_reason.sh usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
s6100/scripts/warm-reboot_plugin usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
s6100/scripts/soft-reboot_plugin usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
s6100/scripts/override.conf /etc/systemd/system/systemd-reboot.service.d
common/dell_lpc_mon.sh usr/local/bin
s6100/scripts/s6100_ssd_mon.sh usr/local/bin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/bin/bash
SSD_FW_UPGRADE="/host/ssd_fw_upgrade"

_error_msg(){
echo "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!"
echo "soft-/fast-/warm-reboot is allowed."
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!"
logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed."
}

# Check SSD Status
if [ -e $SSD_FW_UPGRADE/GPIO7_low ] || [ -e $SSD_FW_UPGRADE/GPIO7_error ] || [ -e $SSD_FW_UPGRADE/GPIO_pending_upgrade ]; then
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty and does not support cold reboot."
logger -p user.crit -t DELL_S6100_SSD_MON "Please perform a soft-/fast-/warm-reboot instead"
if [ -e $SSD_FW_UPGRADE/GPIO7_low ] || [ -e $SSD_FW_UPGRADE/GPIO7_error ] || [ -e $SSD_FW_UPGRADE/GPIO7_pending_upgrade ]; then
_error_msg
exit 1
fi

Expand All @@ -19,8 +25,7 @@ if [ -e $SSD_FW_UPGRADE/GPIO7_high ]; then
if [ $GPIO_STATUS == "0x01" ];then
exit 0
else
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty and does not support cold reboot."
logger -p user.crit -t DELL_S6100_SSD_MON "Please perform a soft-/fast-/warm-reboot instead"
_error_msg
exit 1
fi
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ if [ -e $SSD_FW_UPGRADE/GPIO7_high ]; then
GPIO_STATUS=$(echo "$iSMART_CMD" | grep GPIO | awk '{print $NF}')

if [ $GPIO_STATUS != "0x01" ];then
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty and does not support cold reboot."
logger -p user.crit -t DELL_S6100_SSD_MON "If a reboot is required, please perform a soft-/fast-/warm-reboot."
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!"
logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed."
rm -rf $SSD_FW_UPGRADE/GPIO7_*
touch $SSD_FW_UPGRADE/GPIO7_low
systemctl stop s6100-ssd-monitor.timer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ SSD_UPGRADE_LOG="$SSD_FW_UPGRADE/upgrade.log"
SMART_CMD=`smartctl -a /dev/sda`

SSD_FW_VERSION=$(echo "$SMART_CMD" | grep "Firmware Version" | awk '{print $NF}')
SSD_FW_VERSION=${SSD_FW_VERSION,,}
SSD_MODEL=$(echo "$SMART_CMD" | grep "Device Model" | awk '{print $NF}')

if [ -e $SSD_FW_UPGRADE/GPIO7_pending_upgrade ]; then
if [ $SSD_FW_VERSION == "S141002C" ] || [ $SSD_FW_VERSION == "S16425c1" ]; then
if [ $SSD_MODEL == "3IE" ] && [ $SSD_FW_VERSION == "s141002c" ]; then
# If SSD Firmware is not upgraded
exit 0
fi
if [ $SSD_FW_VERSION == "s16425c1" ] || [ $SSD_FW_VERSION == "s16425cq" ]; then
# If SSD Firmware is not upgraded
exit 0
fi
Expand Down Expand Up @@ -51,47 +56,51 @@ elif [ $SSD_UPGRADE_STATUS2 == "2" ];then

echo "$0 `date` Upgraded to unknown version after second mp_64 upgrade." >> $SSD_UPGRADE_LOG

elif [ $SSD_FW_VERSION == "S141002G" ] || [ $SSD_FW_VERSION == "S16425cG" ]; then
elif [ $SSD_FW_VERSION == "s141002g" ] || [ $SSD_FW_VERSION == "s16425cg" ]; then
# If SSD Firmware is upgraded
GPIO_STATUS=$(echo "$iSMART_CMD" | grep GPIO | awk '{print $NF}')

if [ $GPIO_STATUS != "0x01" ];then
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty and does not support reboot."
logger -p user.crit -t DELL_S6100_SSD_MON "If a reboot is required, please perform a soft-/fast-/warm-reboot."
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!"
logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed."
rm -rf $SSD_FW_UPGRADE/GPIO7_*
touch $SSD_FW_UPGRADE/GPIO7_low
echo "$0 `date` The SSD on this unit is faulty and does not support cold reboot." >> $SSD_UPGRADE_LOG
echo "$0 `date` If a reboot is required, please perform a soft-/fast-/warm-reboot." >> $SSD_UPGRADE_LOG
echo "$0 `date` The SSD on this unit is faulty. Do not power-cycle/reboot this unit!" >> $SSD_UPGRADE_LOG
echo "$0 `date` soft-/fast-/warm-reboot is allowed." >> $SSD_UPGRADE_LOG

else
rm -rf $SSD_FW_UPGRADE/GPIO7_*
touch $SSD_FW_UPGRADE/GPIO7_high
fi

systemctl start --no-block s6100-ssd-monitor.timer

if [ $SSD_UPGRADE_STATUS1 == "0" ]; then
if [ $SSD_MODEL == "3IE" ];then
echo "$0 `date` SSD FW upgraded from S141002C to S141002G in first mp_64." >> $SSD_UPGRADE_LOG
else
echo "$0 `date` SSD FW upgraded from S16425c1 to S16425cG in first mp_64." >> $SSD_UPGRADE_LOG
if [ $SSD_UPGRADE_STATUS1 == "0" ]; then
rm -rf $SSD_FW_UPGRADE/GPIO7_*
touch $SSD_FW_UPGRADE/GPIO7_high
systemctl start --no-block s6100-ssd-monitor.timer

if [ $SSD_MODEL == "3IE" ];then
echo "$0 `date` SSD FW upgraded from S141002C to S141002G in first mp_64." >> $SSD_UPGRADE_LOG
else
echo "$0 `date` SSD FW upgraded from S16425c1 to S16425cG in first mp_64." >> $SSD_UPGRADE_LOG
fi
elif [ $SSD_UPGRADE_STATUS2 == "1" ]; then
rm -rf $SSD_FW_UPGRADE/GPIO7_*
touch $SSD_FW_UPGRADE/GPIO7_low
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!"
logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed."

echo "$0 `date` SSD entered loader mode in first mp_64 and upgraded to latest version after second mp_64." >> $SSD_UPGRADE_LOG
fi
elif [ $SSD_UPGRADE_STATUS2 == "1" ]; then
echo "$0 `date` SSD entered loader mode in first mp_64 and upgraded to latest version after second mp_64." >> $SSD_UPGRADE_LOG
fi

else
if [ $SSD_UPGRADE_STATUS1 == "ff" ] && [ $SSD_UPGRADE_STATUS2 == "ff" ]; then
rm -rf $SSD_FW_UPGRADE/GPIO7_*
touch $SSD_FW_UPGRADE/GPIO7_pending_upgrade

echo "$0 `date` SSD upgrade didn’t happened." >> $SSD_UPGRADE_LOG
echo "$0 `date` SSD upgrade didn’t happen." >> $SSD_UPGRADE_LOG

elif [ $SSD_UPGRADE_STATUS1 == "1" ]; then
rm -rf $SSD_FW_UPGRADE/GPIO7_*
touch $SSD_FW_UPGRADE/GPIO7_low
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty and does not support reboot."
logger -p user.crit -t DELL_S6100_SSD_MON "If a reboot is required, please perform a soft-/fast-/warm-reboot."
logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!"
logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed."

echo "$0 `date` SSD entered loader mode in first mp_64 upgrade." >> $SSD_UPGRADE_LOG

Expand Down

0 comments on commit 6204a1d

Please sign in to comment.