rss logo

Dell PowerEdge T620 : How To Reduce FAN Speed with IPMI

Dell logo Dell PowerEdge T620

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. ⚠️

Enable IPMI over LAN

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. ⚠️

  • Connect to your iDRAC, go to iDRAC Settings > Network and enable IPMI Over LAN:
Dell PowerEdge T620 iDRAC Network Settings showing IPMI Over LAN enabled.

ipmitool utility

Installation under on GNU/Linux

Install the ipmitool software. This utility will enable us to communicate with IPMI.

  • From Debian you can use this command to install ipmitool:
root@host:~# apt-get install ipmitool

Using ipmitool

Check temperature

  • Get temperature information:
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
  • We can see the corresponding values in iDRAC:
Dell PowerEdge T620 temperature probes displaying CPU1, CPU2, and System Board Inlet temperatures.

Controlling FAN Speed

  • To disable manual/static fan control (automatic mode):
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x01 0x01
  • To enable manual/static fan control (manual mode):
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x01 0x00
  • Get the current fanspeed:
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
  • Set fanspeed to 1320 RPM (16%):
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x10
  • Set fanspeed to 1560 RPM (20%):
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x14
  • Set fanspeed to 2040 RPM (30%):
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x1e
  • Set fanspeed to 3000 RPM (50%):
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x32
  • Set fanspeed to 5040 RPM (100%):
user@host:~$ ipmitool -I lanplus -H <iDRAC IP> -U <iDRAC user> -P <iDRAC password> raw 0x30 0x30 0x02 0xff 0x64

Create ipmi service

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

Creating a system account

  • For security reasons, I've decided to run the service with a system account. Here's how to create a system account:
root@host:~# useradd --system --no-create-home ipmiservice
  • Create a log folder:
root@host:~# mkdir /var/log/ipmiservice
root@host:~# chown -R ipmiservice /var/log/ipmiservice

Create a bash script

  • Create the file /usr/local/sbin/ipmiservice.sh:
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
  • Edit the file /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

Creating a systemd service

We're now going to create a systemd service.

  • Create the 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
  • Enable the systemd service:
root@host:~# systemctl enable ipmi.service
  • Start the systemd service:
root@host:~# systemctl start ipmi.service
  • Check log output:
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