Sudden PowerOutage fail proof?

Brononius

Active Member
Apr 6, 2017
28
1
43
48
Hey,

Today I've got a server with 2 power modules.
PU_A straight on the power grid, PU_B over an UPS module.
I was now thinking to write a small script that detects everyt minute the power status of PU_A.
If this goes to '0', the script should re-check in fe 5minutes, and if still '0', then safely/nicely shut down the server.

I was just wondering how bad it can be for a sudden power outage on proxmox.
Can this crash your hypervisor and/or VM's?
Or don't you guys worry about these kind of things?
Just to know if it's worth the effort...
 
Power is always a cause of issues! You can have disks that haven't been properly written to, causing failures of either the host or guest(s).

If you want a reliable server you can trust, reliable power you can trust is a must.

Most people would install a UPS and then run some sort of UPS monitoring software on the host. If the UPS sends the "I've only got 10 minutes left" message then you power down the server.
 
I was wondering if you guys trust your hardwareserver (and power) enough to live with it. ;)
I've got a small UPS, but of course, this won't keep up for hours.

I now wrote a small script to check the power of my server.
And linked with that, do a shutdown. After a series of other checks.

Today, I do just a 'shutdown -h now' of the hypervisor.
Is this OK, or should I first shutdown the VM's?


With other words, will the VM's shutdown properly when I shutdown the hardware server?


The script to check my DELL power, just for reference.
I run this every minute by cron.
Keep in mind that one PU is directly to the net, and one PU on an UPS.
Code:
#!/bin/bash
if omreport chassis pwrsupplies | grep "Redundancy Status" | grep -v Full
    then
        echo "0" > /diy/power_status
        scp /diy/power_status doornroosje:/diy/.
    else
        echo "1" > /diy/power_status
        scp /diy/power_status doornroosje:/diy/.
fi
 
While I have the same question (how to properly shut down the server from command line), I wonder what would happen if one of your power supply fails. Did you take that into account with your script? :)
 
Since I check the status of the redundancy, my output will take the status of the power supply.
If the supply is broken, if the power is lost, if the 'link' between both are broken... the server/power chassis will lose redundancy, so ...

When I shut down the machine over CLI (shutdown -h now), it takes a huge time to be powered off.
So I guess it shut downs properly all VM's?
 
shutdown -h now actually moves things around in the cluster for me so I'd def say its the nice way of shutting down.

shutdown -f<orce> is however a very non-nice way! :D
 

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!