Not so recently, I had to replace Dell-certified mechanical hard drives with non-certified SSDs in a PowerEdge T620 server and was unpleasantly suprised to find that the fans were spinning noisly when inserted.
After a quick search, I discovered that this was a known problem and that Dell was unable to offer a solution… (source: https://www.dell.com/).
Thanks to god/internet, I found a post where a user was able to control the speed of the servers fans with ipmitool. So, big thank you to, tatmde: https://www.reddit.com/.
I'll simply publish here what I did in my situation.
⚠️ Please note that changing the fan speed can cause overheating and damage components. ⚠️
To control FAN speed via the network, we need to enable IPMI over LAN from IDRAC.
⚠️ Enabling IPMI over LAN could be considered a security issue, as a remote station would have the ability to monitor the system's power status and gather information about the platform. ⚠️
Install the ipmitool software. This utility will enable us to communicate with IPMI.
root@host:~# apt-get install ipmitool
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> sdr type temperature
Inlet Temp | 04h | ok | 7.1 | 21 degrees C
Temp | 0Eh | ok | 3.1 | 29 degrees C
Temp | 0Fh | ok | 3.2 | 35 degrees C
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x01 0x01
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x01 0x00
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> sdr get Fan1 Fan2 | grep "Sensor Reading"
Sensor Reading : 1560 (+/- 120) RPM
Sensor Reading : 1560 (+/- 120) RPM
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x10
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x14
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x1e
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x32
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x64
I went crazy and decided to create a service that automatically regulates fan speed.
I'm going to detail here the different steps to set it up.
Note: this script is adapted to my own configuration
root@host:~# useradd --system --no-create-home ipmiservice
root@host:~# mkdir /var/log/ipmiservice
root@host:~# chown -R ipmiservice /var/log/ipmiservice
root@host:~# touch /usr/local/sbin/ipmiservice.sh
root@host:~# chown ipmiservice: /usr/local/sbin/ipmiservice.sh
root@host:~# chmod +x /usr/local/sbin/ipmiservice.sh
#!/bin/bash
#Stops script on errors, unset variables or failing pipeline
set -euo pipefail
#variables definitions
LOG=/var/log/ipmiservice/ipmi.log
IP="192.168.1.10"
PASSWORD='STp@ssw0rd!'
#functions
##Set Fan Speed, accept one argument to set speed
FanSpeed()
{
ipmitool -I lanplus -H "$IP" -U root -P "$PASSWORD" raw 0x30 0x30 0x02 $1
}
##Get Temp values
GetValues()
{
#Get motherboard, cpu1 and cpu2 temperature
OUTPUT=$(/usr/bin/ipmitool -I lanplus -H "$IP" -U root -P "$PASSWORD" sdr type temperature | sed -e 's/Temp\(.*0Eh\)/Cpu1\1/' -e 's/Temp\(.*0Fh\)/Cpu2\1/')
#Extract motherboard temp
SB=$(echo $OUTPUT| awk -F'|' '{ print $5 $9 $13 }' | awk '{ print $1 }')
#Extract cpu1 temp
CPU1=$(echo $OUTPUT| awk -F'|' '{ print $5 $9 $13 }' | awk '{ print $5 }')
#Extract cpu2 temp
CPU2=$(echo $OUTPUT| awk -F'|' '{ print $5 $9 $13 }' | awk '{ print $9 }')
#motherboard+cpu1+cpu2 temp
LOG_TOTAL=$(($SB+$CPU1+$CPU2))
#Get Fan1 speed
FANS=$(ipmitool -I lanplus -H "$IP" -U root -P "$PASSWORD" sensor reading Fan1 | awk '{ print $3 }')
}
#set manual mode
ipmitool -I lanplus -H "$IP" -U root -P "$PASSWORD" raw 0x30 0x30 0x01 0x00
GetValues
echo "$(date "+%Y-%m-%d %H:%M:%S")" "MB : $SB | CPU1 : $CPU1 | CPU2 : $CPU2 | LOG_TOTAL : $LOG_TOTAL"
while :
do
if [ "$LOG_TOTAL" -le 100 ] && [ $FANS -eq 1440 ]; then
echo "$(date "+%Y-%m-%d %H:%M:%S")" "FAN speed : 1440, don't do anything" | tee -a "$LOG"
elif [ "$LOG_TOTAL" -le 100 ] && [ $FANS -ne 1440 ]; then
FanSpeed "0xff 0x12" #Set speed to 1440
echo "$(date "+%Y-%m-%d %H:%M:%S")" "Set speed to 1440" | tee -a "$LOG"
elif [ "$LOG_TOTAL" -gt 100 ] && [ "$LOG_TOTAL" -le 105 ] && [ $FANS -ne 1560 ]; then
FanSpeed "0xff 0x14" #Set speed to 1560
echo "$(date "+%Y-%m-%d %H:%M:%S")" "Set speed to 1560" | tee -a "$LOG"
elif [ "$LOG_TOTAL" -gt 105 ] && [ "$LOG_TOTAL" -le 115 ] && [ $FANS -ne 2040 ]; then
FanSpeed "0xff 0x1e" #Set speed to 2040
echo "$(date "+%Y-%m-%d %H:%M:%S")" "Set speed to 2040" | tee -a "$LOG"
elif [ "$LOG_TOTAL" -gt 115 ] && [ "$LOG_TOTAL" -le 130 ] && [ $FANS -ne 3000 ]; then
FanSpeed "0xff 0x32" #Set speed to 3000
echo "$(date "+%Y-%m-%d %H:%M:%S")" "Set speed to 3000" | tee -a "$LOG"
elif [ "$LOG_TOTAL" -gt 130 ] && [ $FANS -ne 5040 ]; then
FanSpeed "0xff 0x64" #Set speed to 5040
echo "$(date "+%Y-%m-%d %H:%M:%S")" "Set speed to 5040" | tee -a "$LOG"
fi
sleep 30s
GetValues
echo "$(date "+%Y-%m-%d %H:%M:%S")" "MB : $SB | CPU1 : $CPU1 | CPU2 : $CPU2 | TEMP TOTAL : $LOG_TOTAL" >> "$LOG"
echo "$(date "+%Y-%m-%d %H:%M:%S")" "FAN speed : $FANS" | tee -a "$LOG"
done
We're now going to create a systemd service.
root@host:~# vim /etc/systemd/system/ipmi.service
[Unit]
Description=ipmi t620 fan control
After=network.target
[Service]
Type=simple
User=ipmiservice
Group=ipmiservice
WorkingDirectory=/usr/local/sbin/
ExecStart=/usr/local/sbin/ipmiservice.sh
Restart=always
[Install]
WantedBy=multi-user.target
root@host:~# systemctl enable ipmi.service
root@host:~# systemctl start ipmi.service
root@host:~# tail -f /var/log/ipmiservice/ipmi.log
2021-05-09 15:16:57 FAN speed : 1440, don't do anything
2021-05-09 15:17:32 MB : 22 | CPU1 : 37 | CPU2 : 40 | TEMP TOTAL : 99
2021-05-09 15:17:32 FAN speed : 1440, don't do anything
2021-05-09 15:18:04 MB : 22 | CPU1 : 38 | CPU2 : 40 | TEMP TOTAL : 100
2021-05-09 15:18:04 FAN speed : 1440, don't do anything
2021-05-09 15:18:36 MB : 22 | CPU1 : 39 | CPU2 : 40 | TEMP TOTAL : 101
2021-05-09 15:18:36 FAN speed : 1440, don't do anything
2021-05-09 15:18:37 Set speed to 1560
2021-05-09 15:19:09 MB : 22 | CPU1 : 38 | CPU2 : 40 | TEMP TOTAL : 100
2021-05-09 15:19:09 FAN speed : 1560
Contact :