Fencing Agent for Qemu
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>
Hi Matthew,
Quoted 8 lines · Matthew Ife
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.
did you ever consider using fence_virsh or fence_xvm?
They both support libvirt in F10 and higher and they use ssh and authenticated connections to the host system to perform their duties.
I use fence_virsh myself without a problem.
If there is a clear benefit to add fence_qemu compared to what's already in the tree, I am sure our fence agents guys can look at this implementation but I'd rather avoid to have in the tree a possible duplicate.
Cheers
Fabio