Search in sources :

Example 1 with VdsFenceOptions

use of org.ovirt.engine.core.utils.pm.VdsFenceOptions in project ovirt-engine by oVirt.

the class GetAgentFenceOptionsQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    String version = getParameters().getVersion();
    VdsFenceOptions options = new VdsFenceOptions(version);
    HashMap<String, HashMap<String, String>> map = options.getFenceOptionMappingMap();
    getQueryReturnValue().setReturnValue(map);
    getQueryReturnValue().setSucceeded(map.size() > 0);
}
Also used : HashMap(java.util.HashMap) VdsFenceOptions(org.ovirt.engine.core.utils.pm.VdsFenceOptions)

Example 2 with VdsFenceOptions

use of org.ovirt.engine.core.utils.pm.VdsFenceOptions in project ovirt-engine by oVirt.

the class FenceProxyLocator method areAgentsVersionCompatible.

protected boolean areAgentsVersionCompatible(VDS proxyCandidate) {
    VdsFenceOptions options = createVdsFenceOptions(proxyCandidate.getClusterCompatibilityVersion().getValue());
    boolean compatible = true;
    for (FenceAgent agent : getDbFacade().getFenceAgentDao().getFenceAgentsForHost(fencedHost.getId())) {
        if (!options.isAgentSupported(agent.getType())) {
            compatible = false;
            break;
        }
    }
    log.debug("Proxy candidate '{}' has compatible fence agents: {}", proxyCandidate.getHostName(), compatible);
    return compatible;
}
Also used : FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent) VdsFenceOptions(org.ovirt.engine.core.utils.pm.VdsFenceOptions)

Aggregations

VdsFenceOptions (org.ovirt.engine.core.utils.pm.VdsFenceOptions)2 HashMap (java.util.HashMap)1 FenceAgent (org.ovirt.engine.core.common.businessentities.pm.FenceAgent)1