How to get xenserver and associated vms to gracefully shutdown after power failure

electrical-powerxenserver

I'm looking at implementing xenserver and would like to know how to get xenserver to gracefully shutdown all vms after a power failure.

Best Answer

The solutions offered are too simplistic to work in practical situations.

We use the Pacemaker cluster resource manager to manage our virtual machines. Nagios monitors the APC UPSes we have via their network management cards, and runs a script when power failure is imminent to put dom0 servers (also pacemaker nodes) into standby, effectively migrating all resources including virtual machines away from them.

Pacemaker handles the case where resources cannot migrate anywhere relatively gracefully by doing a quick shutdown of the domU machines. As soon as the pcmk node/dom0 machines come back up, the 'resources' (aka domU VMs) get started again where permitted by the pacemaker cluster rules.