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>
This commit is contained in:
Wido den Hollander 2015-07-13 17:26:00 +02:00
parent 8d96aab9b2
commit d1f76a2a84

View File

@ -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);