Search in sources :

Example 1 with NfsStoragePool

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());
    }
}
Also used : NfsStoragePool(com.cloud.agent.resource.computing.KVMHABase.NfsStoragePool) ExecutorService(java.util.concurrent.ExecutorService) FenceAnswer(com.cloud.agent.api.FenceAnswer) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

FenceAnswer (com.cloud.agent.api.FenceAnswer)1 NfsStoragePool (com.cloud.agent.resource.computing.KVMHABase.NfsStoragePool)1 ExecutionException (java.util.concurrent.ExecutionException)1 ExecutorService (java.util.concurrent.ExecutorService)1