[Cluster-devel] Fencing Agent for Qemu

Matthew Ife matthew.ife at airattack-central.com
Fri May 1 21:23:22 UTC 2009


I know there is a fencing agent for Xen but since Redhat have pretty
much dropped all support for Xen now its not very effective for me to
use it. Plus - I prefer KVM/Qemu.

In order to save everyone else the effort, attached is a somewhat
restrictive qemu fencing agent. Its plainly not meant to be used for
production because the hypervisor connection is unauthenticated and
unencrypted.

To set this up (on F10) libvirt needs to be configured to listen for
plain tcp connections within the virtual network that has been setup for
the nodes to operate under.

Also your nodes need libvirt-python installing to use the agent.

The agent takes a number of parameters, "port", "ipaddr", "action".

ipaddr refers to the hypervisor IP address for which the nodes are
children of.

port refers to the VM name given in the hypervisor for the victim node.
action is the action to take, form "status", "reboot", "on", "off".

I'm pretty sure my attempt at this is lacklustre as its my first go.
However I can confirm its definitely working - at least for me!

Attached is my very basic config for this and the agent itself. Put the
agent in /sbin of course and named fence_qemu.

Since I selfishly built it for my purposes only it doesn't do anything
snazzy like ssh or provide auth. Its probably not difficult to add that
though as all the facilities for that live in the libvirt bindings
themselves.

Hope this saves people some time / effort.

Good Luck!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fence_qemu
Type: text/x-python
Size: 3100 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20090501/f5802443/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cluster.conf
Type: application/xml
Size: 1140 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20090501/f5802443/attachment.wsdl>


More information about the Cluster-devel mailing list