use of com.cloud.agent.resource.computing.KVMHABase.NfsStoragePool in project CloudStack-archive by CloudStack-extras.
the class LibvirtComputingResource method execute.
protected FenceAnswer execute(FenceCommand cmd) {
ExecutorService executors = Executors.newSingleThreadExecutor();
List<NfsStoragePool> pools = _monitor.getStoragePools();
KVMHAChecker ha = new KVMHAChecker(pools, cmd.getHostIp());
Future<Boolean> future = executors.submit(ha);
try {
Boolean result = future.get();
if (result) {
return new FenceAnswer(cmd, false, "Heart is still beating...");
} else {
return new FenceAnswer(cmd);
}
} catch (InterruptedException e) {
s_logger.warn("Unable to fence", e);
return new FenceAnswer(cmd, false, e.getMessage());
} catch (ExecutionException e) {
s_logger.warn("Unable to fence", e);
return new FenceAnswer(cmd, false, e.getMessage());
}
}
Aggregations