Share your input/playbook on how you shutdown your homelab?
Last night the house lost power. I’d like to have a playbook I can kick off from my phone (via ssh script to a server) that would gracefully shutdown all my servers while the UPSes are online. Does anyone have something similar they’d like to share or input on my plan below?
I believe what I should do is:
- Docker swarm: stop all services OR pause all nodes.
; goal here is to do this before draining so services will not try and restart on other nodes
; not sure which method is better, also not sure how to stop “all” services instead of a specific list/loop - Docker swarm: drain all worker nodes
- Docker swarm: drain all manager nodes
- Docker swarm: shutdown all nodes
; most graceful way? Is there an Ansible shutdown command? I only see reboot. Shell command? - Docker stand-alones (if any): drain, then shutdown
- Physical servers: shutdown
; any command to execute before shutdown to make it more “graceful”? - DNS: shutdown
- NAS: shutdown
Any other steps I should add? Thanks.
Posted Apr 21, 2020, 4:50 PM UTC
Shutdown all VMs.
Put your cluster in global maintenance mode.
Shutdown all hypervisor hosts that aren't running the engine.
Switch to console and shutdown the engine.
Detach storage then proceed with NAS shutdown.