Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

SOLVED Automatically turn on server after power is restored, but with a delay?

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE
Status
Not open for further replies.

melp

Member
Joined
Apr 4, 2014
Messages
55
I have my UPS set to shut off my server 5 minutes after wall power is lost, but when power is restored, the server stays off. I want to figure out some way to switch the server back on after a delay, say 60 minutes after wall power is restored. I tried setting up a raspberry pi with a sleep 3600; wakeonlan sort of script, but my NIC doesn't support WOL (X10SRL-F onboard). I tried poking around the upsc settings to see if ups.timer.start or .reboot would do what I want, but the documentation isn't very clear.

Currently, as a holdover, I have the BIOS set to boot the machine as soon as the PSU sees power, but I want the delay so the battery has a chance to get juiced up again. Any ideas would be appreciated.

Edit: It's working now, using ipmiutil power -u on an rpi. Had to update the IPMI firmware on my X10 board before it would connect.
 
Last edited:

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Fascinating. I assume you know in the BIOS for this board, you can choose, for "what do when power is restored", to either be "turn on", "keep off", or "whatever the power state was when power was lost". As for something specific like the 60 minute delay, I am intellectually curious as to why you are interested in waiting so long?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I don't want to boot the server unless the UPS has some charge in it, enough to allow it to gracefully shut the server down again if the goes back out.
Ah yes, that seems reasonable. But how much charge will a fully drained UPS have after only 1 hour? Not enough to run the UPS for more than a couple minutes, I don't think, if even that.
 

melp

Member
Joined
Apr 4, 2014
Messages
55
I don't think the solution will change based on how many hours I need the bootup to be delayed by, I was just throwing out 1hr to have something to work with.

I'm messing with ipmiutil on a remote machine, but it's not connecting right. I'm doing:

ipmiutil power -u -N <ipmi IP> -U <ipmi admin> -P <ipmi password> -V 4

and I get an ipmi_open error = -3
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I don't think the solution will change based on how many hours I need the bootup to be delayed by, I was just throwing out 1hr to have something to work with.

I'm messing with ipmiutil on a remote machine, but it's not connecting right. I'm doing:

ipmiutil power -u -N <ipmi IP> -U <ipmi admin> -P <ipmi password> -V 4

and I get an ipmi_open error = -3
This looks to be related:
https://sourceforge.net/p/ipmiutil/mailman/message/26013988/

Problem probably has to do with authentication type being incorrect?
 

melp

Member
Joined
Apr 4, 2014
Messages
55
Tried with -T 1 and -T 4, got the same result:

Code:
jfr@WoL:~ $ ipmiutil health -N 192.168.2.151 -U user -P password -V 2 -T 1 -x
ipmiutil ver 3.01
ihealth ver 3.01
ipmi_open: driver type =
ipmi_open_lan: fdebug = 1
Opening lan connection to node 192.168.2.151 ...
socket(2,2,17), connect(3) rv = 0
open_sockfd returned 0, fd=3
Connecting to node 192.168.2.151
calling get_rand(1)
ipmilan_open_session(3,01,user,02,30347f85) called
GetChanAuth(sock 3, level 2) called
ipmilan_sendto(seq=0,clen=23)
ipmilan_cmd timeout, after request, seq=0 itry=0
ipmilan_cmd timeout, after request, seq=0 itry=1
ipmilan_cmd timeout, after request, seq=0 itry=2
ipmilan_cmd timeout, after request, seq=0 itry=3
_ipmilan_cmd[38]: rv = -3, cc=0 rs_len=205
ipmilan_sendto(seq=0,clen=23)
ipmilan_cmd timeout, after request, seq=0 itry=0
ipmilan_cmd timeout, after request, seq=0 itry=1
ipmilan_cmd timeout, after request, seq=0 itry=2
ipmilan_cmd timeout, after request, seq=0 itry=3
_ipmilan_cmd[38]: rv = -3, cc=0 rs_len=205
GetChanAuth rv = -3, cc=0 rbuf: 00 00 00 00 00 00 00
ipmilan_open_session error, rv = -3
ipmilan receive from BMC failed
ipmi_open rc = -3 type = lan
Driver type lan, open rc = -3
ipmi_open error = -3
ipmi_close_lan(192.168.2.151) entry, sockfd=0
ipmi_close_lan(192.168.2.151) rv=0 sockfd=0
ipmiutil health, receive from BMC failed
 

melp

Member
Joined
Apr 4, 2014
Messages
55
I'm so confused right now. All the IPMI network settings look correct, but I can't even connect to the IPMI net interface from the local machine:

Code:
[jfr@london ~]$ sudo ipmitool lan print
Set in Progress		 : Set Complete
Auth Type Support	   : NONE MD2 MD5 PASSWORD
Auth Type Enable		: Callback : MD2 MD5 PASSWORD
						: User	 : MD2 MD5 PASSWORD
						: Operator : MD2 MD5 PASSWORD
						: Admin	: MD2 MD5 PASSWORD
						: OEM	  : MD2 MD5 PASSWORD
IP Address Source	   : DHCP Address
IP Address			  : 192.168.2.151
Subnet Mask			 : 255.255.255.0
MAC Address			 : 0c:c4:7a:dc:ec:5c
SNMP Community String   : public
IP Header			   : TTL=0x00 Flags=0x00 Precedence=0x00 TOS=0x00
BMC ARP Control		 : ARP Responses Enabled, Gratuitous ARP Disabled
Default Gateway IP	  : 192.168.2.1
Default Gateway MAC	 : 38:2c:4a:cb:cc:00
Backup Gateway IP	   : 0.0.0.0
Backup Gateway MAC	  : 00:00:00:00:00:00
802.1q VLAN ID		  : Disabled
802.1q VLAN Priority	: 0
RMCP+ Cipher Suites	 : 1,2,3,6,7,8,11,12
Cipher Suite Priv Max   : XaaaXXaaaXXaaXX
						:	 X=Cipher Suite Unused
						:	 c=CALLBACK
						:	 u=USER
						:	 o=OPERATOR
						:	 a=ADMIN
						:	 O=OEM
Bad Password Threshold  : Not Available
[jfr@london ~]$ sudo ipmitool -H 192.168.2.151 -U user -P password sensor
Error: Unable to establish LAN session
Error: Unable to establish IPMI v1.5 / RMCP session
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
So, is it then working as desired?
 
Status
Not open for further replies.
Top