Ondřej Kunc
2013-Dec-09 12:01 UTC
[libvirt-users] Determine ongoing shutdown via libvirt or preventing migrations to host
Hi list, Is there any function in libvirt to determine runlevel of host or any possibility to prevent VM migrations to that host ? I'm developing simple cluster of 4 servers running KVM VMs. For management I decided to use python-libvirt. It is working in that way, that every VM is diskless and booting via PXE so I can run it on every host server. Every VM has assigned one host as monitor which is responsible to periodically check, that VM is running on one of other hosts. If it don't run, it will be started on first available server assigned for that VM. When one of hosts is shut down, it will migrate all VMs to another hosts, but that monitor which checks VMs will migrate it after reboot. But I have race condition there that monitors can check that host is running before it is shutdown and will migrate VM's back to server which will reboot. Thank you for any help -- Ondřej Kunc, Senior Linux Administrator IGNUM s.r.o., Vinohradská 190, Praha 3, 130 61, CZE Mobil: +420 603 111 111 | Fax: +420 296 332 222 www.ignum.cz | www.domena.cz | www.webcloud.cz
Daniel P. Berrange
2013-Dec-10 13:34 UTC
Re: [libvirt-users] Determine ongoing shutdown via libvirt or preventing migrations to host
On Mon, Dec 09, 2013 at 01:01:43PM +0100, Ondřej Kunc wrote:> Hi list, > > Is there any function in libvirt to determine runlevel of host or > any possibility to prevent VM migrations to that host ? > > I'm developing simple cluster of 4 servers running KVM VMs. For > management I decided to use python-libvirt. It is working in that > way, that every VM is diskless and booting via PXE so I can run it > on every host server. Every VM has assigned one host as monitor > which is responsible to periodically check, that VM is running on > one of other hosts. If it don't run, it will be started on first > available server assigned for that VM. When one of hosts is shut > down, it will migrate all VMs to another hosts, but that monitor > which checks VMs will migrate it after reboot. But I have race > condition there that monitors can check that host is running before > it is shutdown and will migrate VM's back to server which will > reboot. > > Thank you for any helpThat kind of policy decision making is outside the scope of libvirt I'm afraid. The higher level management tools using libvirt would need to figure out that kind of stuff. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Ondřej Kunc
2013-Dec-10 15:05 UTC
Re: [libvirt-users] Determine ongoing shutdown via libvirt or preventing migrations to host
Hi Daniel, Thank you for your reply. I agree that runlevel is not directly related to VM management so it is OK, that it is not implemented in libvirt library. What about prevention of VM migrations, is it acceptable to just close migration port in firewall ? Thank you Ondřej Dne 10.12.2013 14:34, Daniel P. Berrange napsal(a):> On Mon, Dec 09, 2013 at 01:01:43PM +0100, Ondřej Kunc wrote: >> Hi list, >> >> Is there any function in libvirt to determine runlevel of host or >> any possibility to prevent VM migrations to that host ? >> >> I'm developing simple cluster of 4 servers running KVM VMs. For >> management I decided to use python-libvirt. It is working in that >> way, that every VM is diskless and booting via PXE so I can run it >> on every host server. Every VM has assigned one host as monitor >> which is responsible to periodically check, that VM is running on >> one of other hosts. If it don't run, it will be started on first >> available server assigned for that VM. When one of hosts is shut >> down, it will migrate all VMs to another hosts, but that monitor >> which checks VMs will migrate it after reboot. But I have race >> condition there that monitors can check that host is running before >> it is shutdown and will migrate VM's back to server which will >> reboot. >> >> Thank you for any help > > That kind of policy decision making is outside the scope of > libvirt I'm afraid. The higher level management tools using > libvirt would need to figure out that kind of stuff. > > > Daniel >-- S pozdravem, Ondřej Kunc, Senior Linux Administrator IGNUM s.r.o., Vinohradská 190, Praha 3, 130 61, CZE Mobil: +420 603 111 111 | Fax: +420 296 332 222 www.ignum.cz | www.domena.cz | www.webcloud.cz
Possibly Parallel Threads
- Re: Determine ongoing shutdown via libvirt or preventing migrations to host
- Determine ongoing shutdown via libvirt or preventing migrations to host
- Re: Ceph RBD locking for libvirt-managed LXC (someday) live migrations
- Does libvirt support intra-host KVM migration?
- Re: Is there a way to disable libvirt qemu monitor while creating kvm vm using virsh?