Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some server applications failing because their virtual machine starts up before the database virtual machines. Anyway to configure libvirt to start them up in a certain order and possible insert delays in front of some of them?

Running libvirt 0.9.8 on Ubuntu 12.04 x64. Most of the guests are also Ubuntu Server 12.04.

share|improve this question

libvirt only provides the autostart function. If this is important for you, I would set up an init script that starts VMs in a certain order. The algorithm would be virsh start VM1; wait for service to come up (check with ping/snmp/telnet to relevant ports); virsh start VM2 and so on

share|improve this answer
I have the same trouble and tried init script solution. But it didn't work. There maybe some problem in my script since I'm not good at shell script. Could you please have a look and help me out? It's here – John Wang Oct 12 '13 at 1:10
those symlinks are generated by libvirt and are not there to be placed manually. If you want to know what else libvirt does besides creating those symlinks, you should read the code – dyasny Oct 12 '13 at 2:06

You could use sleeps in the RC init scripts, but I would change the server applications to check for the existence of db's and any other dependencies before starting. Much better to have the test happen at the application, rather than in the HV-guest configuration.

If you can't change the app itself, then you can use its init script to make the test.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.