[Gluster-users] Gluster v 3.3 with KVM and High Availability

Whit Blauvelt whit.gluster at transpect.com
Wed Jul 11 18:42:35 UTC 2012

On Wed, Jul 11, 2012 at 05:56:00PM +0000, Barlow, Jim D wrote:

> As far as fencing  goes, I have done nothing.     I'm manually as
> carefully as I can manage using virt-manager. I've already accidentally
> started the same VM on two bricks. Watch your autostart settings on the
> VMs :-)

There's another, much cruder way to prevent running from two systems at
once. If you create a directory /etc/libvirt/hooks and then put a file
"qemu" in it, that file will be run each time you start a VM (and a few
other events - depends on your libvirt version which). The script gets
passed the VM name and the operation (e.g. "start"). So I have a script
there that first tries to ping the VM, and if that fails runs virsh via ssh
on the other system to see if the VM is either "shut off" or "paused"
(necessary for live migration) there. So if the VM's not pingable (via the
LAN interface) and either the other host isn't pingable either (via a
crossover between hosts) or it is and virsh confirms the VM is shut off or
paused there, then I have virsh start the VM locally.

Obviously there will be better ways to handle this. But it's better than
nothing. After creating the hooks directory, libvirt requires a restart to
see it.


More information about the Gluster-users mailing list