▲ | rollcat 2 days ago | |||||||
> I had original plans to turn the lab off at night and then the phone could keep running from battery. But, the homelab became critical infra and has to be always on lol. I've rebuilt my entire setup a while ago to "tolerate" power loss. - Everything is sliced into three zones: "always-on", "desktop", and "homelab". The latter two through a smart plug, so that power can be cut. - Always-on includes the SOHO router/AP, a RasPi4, and my Mac mini. The router's switch has only two ports populated: the Pi, and the Big Switch. - Desktop is things like the screen, speakers, dock, wireless charger, camera (dummy battery), cute lamp, etc. All of this can tolerate power loss at any moment. Homelab: this is the tricky part. There's a big (52 ports!) switch that "everything else" is plugged into, including my Mac (yay 10Gig Ethernet, not sure what for). A bunch of SBCs like Pis, NVidia Jetsons, x86's, etc. Nothing important, still figuring out what to do with all of that, so I kinda don't care if the power is cut. The important bit is the NAS (RAIDZ 3x3TB). ZFS makes you feel like you're invincible, but I've still built something to keep it clean: 1. it's powered down until required; 2. the router has a cron job to WoL the NAS 5min before all backup jobs start; 3. the NAS has its own cron job that waits for the backups to complete, then waits for all SSH sessions to terminate, then shuts itself down. You can kill the script via SSH. What I'm planning to do is to build a simple daemon for each box, that checks in once per minute or so, to ask if it's time to shut down. Once everyone is clear, cut the power. Somewhere far down my TODO list ;) until then, you can also use an iOS shortcut to SSH to each box before asking HomeKit to throw the switch, but storing passwords is fugly and handling separate pubkeys is too much bother. So I'm mostly happy with it as-is. | ||||||||
▲ | youainti a day ago | parent [-] | |||||||
I think you might be interested in NUTs, Network UPS Tools. They provide a way to distribute power information about a ups across a network. | ||||||||
|