this post was submitted on 29 Apr 2024
43 points (100.0% liked)

Chat

7455 readers
18 users here now

Relaxed section for discussion and debate that doesn't fit anywhere else. Whether it's advice, how your week is going, a link that's at the back of your mind, or something like that, it can likely go here.


Subcommunities on Beehaw:


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
 

busy as usual, currently reading Alt-America (David Neiwert)

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 5 points 2 months ago (2 children)

It's going. It's been a very busy couple days already at work. But I talked about work last week, so I'll give an update on something more interesting (to me): My homelab! ๐Ÿค“

My UPS arrived like a week ago. I set it up and hooked up devices to it: server, router, and a small switch are on the battery backup. Which gets me about 17min of runtime on the battery if power fails. Pretty good.

I was able to install the UPS software as an ESXi VM. And I got that to communicate with the ESXi host. Configured some delays to ensure it didn't try to shutdown the server due to a momentary blackout/brownout, and I even got the software to send me email notifications (thank you SMTP2GO).

Then it was time. I unplugged the UPS from the wall. And waited for it run out of battery. And guess what? It shut down the server! Even before the UPS completely ran out of power. That said, I didn't take a stopwatch to it, or really get a chance to monitor how it was shutting down VMs. It looked like they were all shut down properly after I powered on the VMs again, but I can't say for certain. I could tighten this up. Either way, it basically did what it was supposed to do.

Next thing I need to figure out is how to get it to boot the server back up once wall power is back. I have some ideas on how to do it manually (if I wasn't home when power was lost), but I think it'd be neat to figure out how to do it automatically.

[โ€“] [email protected] 4 points 2 months ago

Yay for a UPS! I'm sure you'll find some funky way of getting automagic reboots going.

[โ€“] [email protected] 3 points 2 months ago (1 children)

Congrats on your new setup! A UPS is never a bad idea.

As for the auto power-on, check the BIOS settings. Most have an option that says somehing along the lines of "computer power state after plugging it in" and you can usually set it to on, off or whatever it was before power loss.

[โ€“] [email protected] 3 points 1 month ago* (last edited 1 month ago) (1 children)

Good idea. I did check the BIOS and that setting was already enabled. So I unplugged the UPS from the wall to simulate and test. Unfortunately, the server didn't boot automatically after I plugged the UPS back into the wall. And I remembered that in the past, when the power went out due to storms or something, the server did automatically boot on resumption of power.

I think I know what's going on.

With the server and a couple small networking devices on the UPS, I get about 16-17min of battery power. After a few minutes on battery power only, the UPS sends the commands to ESXI to start shutting down VMs and then eventually shuts down the server completely. That takes about 10min. That means there's still battery power remaining, and now with the server off, the largest load on the UPS, the remaining battery time increases to like 40min since the total load on the UPS is now much smaller. However, there's still technically power being served to the server; there's even a small light on the back of the server that stayed on the whole time.

Plugging the UPS back in the wall didn't do anything, which I kinda expected. It's not going to "send" more power to the server to "wake it up." I think the only way the server would turn back on automatically in this situation is if the power outage was long enough to completely drain the UPS and turn the UPS off completely. So at least 40min. Then there would be absolutely no power being given to the server. Once wall power is back, the UPS itself turns back on, which sends a little bit of power to the server, which the server BIOS recognizes as "Hey, I was actually without any power at all, but I have power now! Boot!" I'll test that out next weekend.

So for outages less than 40min, the best bet would be doing a remote desktop into a computer on my network, accessing the web GUI for IDRAC, the server's out-of-band-management software, and then powering on the server from there. I tried this out and it worked fine.

Not automatic in all cases, but as long as I have a manual means to restart the server remotely, that'll do.

Sorry for the long post; I wrote this down mostly for myself to work it all out!

[โ€“] [email protected] 2 points 1 month ago (2 children)

Hmm, the way you describe it makes sense.
You'll probably want to send the UPS a command to kill the power after shutdown is complete. I'm not sure what software you use on the server (if any) to manage the UPS, and not too familiar with them anyway, but a common concept would be: UPS reports power failure with <$minimum runtime remaining, server shuts down gracefully and sends a "kill power" command to the UPS at the end of its shutdown sequence, UPS kills power, power eventually returns, UPS turns back on, server gets power again and reboots.

I know APC PowerChute and whatever software comes with HPE UPSes can do that.
It also means your UPS has some runtime left in case of emergency or if the power returns and quickly fails again.

[โ€“] [email protected] 2 points 1 month ago (1 children)

Sorry to "necro" this thread, but I just got around to enabling and testing out your UPS kill command suggestion. Everything shutdown as planned, including the UPS itself. Once I restored wall power to the UPS, power started flowing to the server automatically, the BIOS detected it, and the server booted-up on its own! Success! ESXi is back up and VMs are still in the process of auto-starting. This is exactly how I wanted it all to work.

Thanks again for the suggestion!

[โ€“] [email protected] 2 points 1 month ago

Glad it worked, and thanks for the feedback!

[โ€“] [email protected] 1 points 1 month ago

Ah, I have the seen that option to kill the UPS after shutdown, but I left it disabled because I didn't understand what it did. And the documentation from Cyberpower is pretty lacking. But I'll try that enabling that option, testing, then seeing what happens.

I appreciate the tips you're giving me here!