mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
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:
parent
8d96aab9b2
commit
d1f76a2a84
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user