Hi,

29.09.2011 17:47, Nick Khamis wrote:
> Hello Dejan,
> 
> Sorry to hijack, I am also working on the same type of setup as a prototype.
> What is the best way to get stonith included for VM setups? Maybe an
> SSH stonith?
> Again, this is just for the prototype.

You may look at fence-virt.
I use fence-virtd-libvirt-qpid (with two my patches which fix grave
bugs, names of patches say for themselves) and fence_xvm.
It's still not ideal (f.e. it does not work if several hosts know one
VM), but it may work well under some circumstances:
* You set up qpid server
* You run fence_virtd on every host and publish libvirtd data on that
qpid server
* You ensure that only one host has any VM listed in qpid (read: in
virsh list). F.e you unconditionally use virsh undefine after vm is stopped.
* You fix its bugs (at least with my patches)

Patches are attached.

Best,
Vladislav

P.S. Patches could be also interesting for fence-virt author if he reads
this list. It would be great if somebody point him to them otherwise.
diff -urNp fence-virt-0.2.1.orig/server/libvirt-qpid.cpp fence-virt-0.2.1/server/libvirt-qpid.cpp
--- fence-virt-0.2.1.orig/server/libvirt-qpid.cpp	2010-01-15 14:01:17.000000000 +0100
+++ fence-virt-0.2.1/server/libvirt-qpid.cpp	2011-03-11 17:16:15.639237598 +0100
@@ -246,7 +246,7 @@ lq_status(const char *vm_name, void *pri
 	VALIDATE(priv);
 	printf("[libvirt-qpid] STATUS operation on %s\n", vm_name);
 
-	return do_lq_request((lq_info *)priv, vm_name, "destroy");
+	return do_lq_request((lq_info *)priv, vm_name, "status");
 }
 
 
diff -urNp fence-virt-0.2.1.orig/server/libvirt-qpid.cpp fence-virt-0.2.1/server/libvirt-qpid.cpp
--- fence-virt-0.2.1.orig/server/libvirt-qpid.cpp	2010-01-15 14:01:17.000000000 +0100
+++ fence-virt-0.2.1/server/libvirt-qpid.cpp	2011-03-11 17:16:15.639237598 +0100
@@ -165,9 +165,9 @@ do_lq_request(struct lq_info *info, cons
 	    !strcmp( vm_state, "idle" ) ||
 	    !strcmp( vm_state, "paused" ) ||
 	    !strcmp( vm_state, "no state" ) ) {
-		i = RESP_OFF;
-	} else {
 		i = 0;
+	} else {
+		i = RESP_OFF;
 	}
 
 	if (!strcasecmp(action, "status")) {
@@ -176,12 +176,12 @@ do_lq_request(struct lq_info *info, cons
 	}
 
 	result.code = 1;
-	if (!strcasecmp(action, "destroy") && !i) {
+	if (!strcasecmp(action, "destroy") && i == RESP_OFF) {
 		std::cout << "Domain is inactive; nothing to do" << std::endl;
 		result.code = 0;
 		goto out;
 	}
-	if (!strcasecmp(action, "create") && i) {
+	if (!strcasecmp(action, "create") && i != RESP_OFF) {
 		std::cout << "Domain is active; nothing to do" << std::endl;
 		result.code = 0;
 		goto out;
_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker

Reply via email to