Best power management practices for home use.

helloha

New Member
Sep 19, 2021
17
0
1
79
Hi everyone,

I'm running a Supermicro X9SCL-F with an e3-1270 v2 in a Supermicro 2U CSE-825 chassis with a 500watt gold PSU. I only have 3 Sata ssd's for system and data.

I run proxmox with a bunch of VM's. Pfsense, unifi controller, pihole, nextcloud server...

When all services are running at idle the system pulls about 50watt from the wall.

It seems that 50watt from the wall is about as low as you can go with x86 systems. Even more modern ones.

I was wondering what other people are doing to limit power consumption in a home environment. Has anyone for example been able to automaticall power off the system at night and automatically power on the in the morning?

Any thoughts?

Cheers,
Karel.
 
When all services are running at idle the system pulls about 50watt from the wall.
That is not much for a server, mine take a lot more (>200W)

I was wondering what other people are doing to limit power consumption in a home environment.
Using low-power or embedded systems. Mine has 9-11 W depending on load (Intel Atom J4205, 16 GB-RAM, 2x 240GB Samsung Enterprise SSD).
 
And as always...the older your hardware is, the more power inefficient it will be.
Atleast your main server should run 24/7. If you got some additional servers that aren't needed all the time (like a PBS server for weekly backups) you can use WoL or IPMI to remote boot them when needed.
 
Been thinking along the same lines myself

Powering down the server at night should be simple enough with a cron script, powering it back on again in the morning is the challenge.

The trick is turning the server back on again in the morning. Like you, I've got a SuperMicro server so I wondered if I could program something like a Raspberry Pi to power the server on via the IPMI interface. Got no further than just wondering though although the next power bill may provide a bit of motivation :)
 
The trick is turning the server back on again in the morning. Like you, I've got a SuperMicro server so I wondered if I could program something like a Raspberry Pi to power the server on via the IPMI interface. Got no further than just wondering though although the next power bill may provide a bit of motivation :)
Whats basically what I'm doing with my backup TrueNAS server.

1.) cron triggers a bash script on my main TrueNAS server
2.) bash script uses ipmitool to start the backup TrueNAS server (also using supermicro board)
3.) bash script uses TrueNAS API to wait untail backup TrueNAS server has finished booting and will then auto unlock my encrypted pools
4.) bash script will initialize ZFS replication and monitor replication and scrub progress using the TRUENAS API
5.) once no replication or scrub is running anymore the bash script will use the TRUENAS API to shutdown the backup TrueNas server again

I guess you could do the same using the PVE API.

The IPMI parts of my bash script:
Code:
...
IPMIIP="192.168.43.21" # IPMI IP of the replication target
IPMIUSER="YourUSER" # IPMI user (atleast with OPERATOR rights to be able to power un the remote host)
IPMIPWDFILE="/mnt/pool/encrypteddataset/keys/ipmi_backupnas.pwd" # file containing password
...
IPMIPORT=623 # port of remote IPMI
...
# checks the power status of the remote host. Returns 0 if "on", 1 if "off", 2 on other states and 3 on error.
function checkPowerStatus {
    local retries=3
    local waittime=30
    local rtn=3
    local powerstatus
    for (( i=0; i<$retries; i++ )); do
        powerstatus=$(ipmitool -I lanplus -H ${IPMIIP} -U ${IPMIUSER} -f ${IPMIPWDFILE} -p ${IPMIPORT} -L OPERATOR power status)
        if [ $? -eq 0 ]; then
            case "$powerstatus" in
               "Chassis Power is off")
                    rtn=1 ;;
               "Chassis Power is on")
                    rtn=0 ;;
               *)  
                    rtn=2 ;;
            esac
            if [ $rtn -ne 3 ]; then
                break
            fi
        else
            sleep $waittime
        fi
    done
    return $rtn
}
...
# starts remote host using IPMI and waits until it is powered on. Returns 0 if sucessfully powered up, 1 on error.
function startRemoteHost {
    local commandretries=3
    local commandtimeout=10
    local waitretries=12
    local startuptimeout=10
    local rtn=1
    local commandsent=1
    local i
    local poweruptext
    # try to send power up command
    for (( i=0; i<$commandretries; i++ )); do
        poweruptext=$(ipmitool -I lanplus -H ${IPMIIP} -U ${IPMIUSER} -f ${IPMIPWDFILE} -p ${IPMIPORT} -L OPERATOR power on)
        if [ $? -eq 0 ]; then
            commandsent=0
            break
        else
            sleep $commandtimeout
        fi
    done
    # wait until remote host is powered on
    for (( i=0; i<$waitretries; i++ )); do
        checkPowerStatus
        if [ $? -eq 0 ]; then
            # host ist powered on
            rtn=0
            break
        else
            # not powered on yet so wait
            sleep $commandtimeout
        fi
    done
    return $rtn
}
...
 
  • Like
Reactions: bobmc
Whats basically what I'm doing with my backup TrueNAS server.

1.) cron triggers a bash script on my main TrueNAS server
2.) bash script uses ipmitool to start the backup TrueNAS server (also using supermicro board)
3.) bash script uses TrueNAS API to wait untail backup TrueNAS server has finished booting and will then auto unlock my encrypted pools
4.) bash script will initialize ZFS replication and monitor replication and scrub progress using the TRUENAS API
5.) once no replication or scrub is running anymore the bash script will use the TRUENAS API to shutdown the backup TrueNas server again

I guess you could do the same using the PVE API.

The IPMI parts of my bash script:
Code:
...
IPMIIP="192.168.43.21" # IPMI IP of the replication target
IPMIUSER="YourUSER" # IPMI user (atleast with OPERATOR rights to be able to power un the remote host)
IPMIPWDFILE="/mnt/pool/encrypteddataset/keys/ipmi_backupnas.pwd" # file containing password
...
IPMIPORT=623 # port of remote IPMI
...
# checks the power status of the remote host. Returns 0 if "on", 1 if "off", 2 on other states and 3 on error.
function checkPowerStatus {
    local retries=3
    local waittime=30
    local rtn=3
    local powerstatus
    for (( i=0; i<$retries; i++ )); do
        powerstatus=$(ipmitool -I lanplus -H ${IPMIIP} -U ${IPMIUSER} -f ${IPMIPWDFILE} -p ${IPMIPORT} -L OPERATOR power status)
        if [ $? -eq 0 ]; then
            case "$powerstatus" in
               "Chassis Power is off")
                    rtn=1 ;;
               "Chassis Power is on")
                    rtn=0 ;;
               *) 
                    rtn=2 ;;
            esac
            if [ $rtn -ne 3 ]; then
                break
            fi
        else
            sleep $waittime
        fi
    done
    return $rtn
}
...
# starts remote host using IPMI and waits until it is powered on. Returns 0 if sucessfully powered up, 1 on error.
function startRemoteHost {
    local commandretries=3
    local commandtimeout=10
    local waitretries=12
    local startuptimeout=10
    local rtn=1
    local commandsent=1
    local i
    local poweruptext
    # try to send power up command
    for (( i=0; i<$commandretries; i++ )); do
        poweruptext=$(ipmitool -I lanplus -H ${IPMIIP} -U ${IPMIUSER} -f ${IPMIPWDFILE} -p ${IPMIPORT} -L OPERATOR power on)
        if [ $? -eq 0 ]; then
            commandsent=0
            break
        else
            sleep $commandtimeout
        fi
    done
    # wait until remote host is powered on
    for (( i=0; i<$waitretries; i++ )); do
        checkPowerStatus
        if [ $? -eq 0 ]; then
            # host ist powered on
            rtn=0
            break
        else
            # not powered on yet so wait
            sleep $commandtimeout
        fi
    done
    return $rtn
}
...
Cool, but you still need a separate device to connect to IPMI to power on the system...

You could also use home assistant to switch a power relay at a specific time and configure the bios to power on when power is restored on the circuit.

But my home assistant lives on a VM on my server...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!