cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [2/2] git commit: updated refs/heads/master to fbe3b04
Date Fri, 17 Jul 2015 10:33:22 GMT
CLOUDSTACK-8628: kvm: Disable Fencing when no NFS storage pools are present

On NFS we write a heartbeat, but without those we can not safely
fence off a host.

If we fence without knowing about a heartbeat we can cause a split-brain situation.

Signed-off-by: Wido den Hollander <wido@widodh.nl>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d1f76a2a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d1f76a2a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d1f76a2a

Branch: refs/heads/master
Commit: d1f76a2a84c531a73285630c4f6283dc17143f82
Parents: 8d96aab
Author: Wido den Hollander <wido@widodh.nl>
Authored: Mon Jul 13 17:26:00 2015 +0200
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Fri Jul 17 12:33:11 2015 +0200

----------------------------------------------------------------------
 .../resource/wrapper/LibvirtFenceCommandWrapper.java    | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d1f76a2a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
index 8fdf46b..cb313df 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtFenceCommandWrapper.java
@@ -48,6 +48,18 @@ public final class LibvirtFenceCommandWrapper extends CommandWrapper<FenceComman
         final KVMHAMonitor monitor = libvirtComputingResource.getMonitor();
 
         final List<NfsStoragePool> pools = monitor.getStoragePools();
+
+        /**
+         * We can only safely fence off hosts when we use NFS
+         * On NFS primary storage pools hosts continuesly write
+         * a heartbeat. Disable Fencing Off for hosts without NFS
+         */
+        if (pools.size() == 0) {
+            String logline = "No NFS storage pools found. No way to safely fence " + command.getVmName()
+ " on host " + command.getHostGuid();
+            s_logger.warn(logline);
+            return new FenceAnswer(command, false, logline);
+        }
+
         final KVMHAChecker ha = new KVMHAChecker(pools, command.getHostIp());
 
         final Future<Boolean> future = executors.submit(ha);


Mime
View raw message