2

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.

3 Answers 3

4

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

2
  • 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, 2013 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, 2013 at 2:06
2

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.

1

You can also use KVM_AutoBoot ( https://github.com/eduardolucioac/kvm_autoboot ) to start one or several virtual machines at server boot using KVM (libvirt). It is also possible to define an interval between the start of a virtual machine and the next one.

Thanks! =D

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .