Search in sources :

Example 1 with FenceVdsVDSCommandParameters

use of org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters in project ovirt-engine by oVirt.

the class FenceVdsVDSCommandTest method setupCommandParams.

private FenceVdsVDSCommandParameters setupCommandParams(FenceActionType fenceAction) {
    FenceAgent agent = new FenceAgent();
    agent.setIp("1.2.3.4");
    agent.setPort(1234);
    agent.setType("ipmilan");
    agent.setUser("admin");
    agent.setPassword("admin");
    agent.setOptions("");
    return new FenceVdsVDSCommandParameters(PROXY_HOST_ID, TARGET_HOST_ID, agent, fenceAction, null);
}
Also used : FenceVdsVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters) FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent)

Example 2 with FenceVdsVDSCommandParameters

use of org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters in project ovirt-engine by oVirt.

the class FenceAgentExecutor method executeFenceAction.

protected FenceOperationResult executeFenceAction(FenceActionType action, FenceAgent agent, VDS proxyHost) {
    FenceAgent realAgent = createRealAgent(agent, proxyHost);
    auditFenceActionExecution(action, realAgent, proxyHost);
    VDSReturnValue retVal = resourceManager.runVdsCommand(VDSCommandType.FenceVds, new FenceVdsVDSCommandParameters(proxyHost.getId(), fencedHost.getId(), realAgent, action, convertFencingPolicy(proxyHost)));
    FenceOperationResult result = (FenceOperationResult) retVal.getReturnValue();
    log.debug("Result of '{}' fence action: {}", result);
    if (result == null) {
        log.error("FenceVdsVDSCommand finished with null return value: succeeded={}, exceptionString='{}'", retVal.getSucceeded(), retVal.getExceptionString());
        log.debug("Exception", retVal.getExceptionObject());
        result = new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN, retVal.getExceptionString());
    }
    if (result.getStatus() == Status.ERROR) {
        auditFenceActionFailure(action, realAgent, proxyHost);
    }
    return result;
}
Also used : FenceVdsVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters) FenceOperationResult(org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult) FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Aggregations

FenceAgent (org.ovirt.engine.core.common.businessentities.pm.FenceAgent)2 FenceVdsVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters)2 FenceOperationResult (org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1