virsh auto restart after vm died

paskl asked:

We have several VMs on our system. Sometimes there seems to be an issue with RAM management on the host system and one system dies quietly.

We have setup the VMs to autostart on host start, which works fine. But what about this scenario:

  1. Host autostarts VMs on start up
  2. One VM dies quietly for whatever reason
  3. VM does not run anymore therefore some key services running on the VM are not available

How can I setup the VM to automatically restart itself when its not running (But dont spawn multiple instances) after initial autostart using virsh ?


My answer:

Check your domain XML for the value of <on_crash>.

This should be set to:


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.