Search in sources :

Example 1 with AddGlusterServerVDSParameters

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

the class InitGlusterCommandHelper method glusterPeerProbe.

private boolean glusterPeerProbe(VDS vds, Guid upServerId, String newServerName) {
    try {
        VDSReturnValue returnValue = runVdsCommand(VDSCommandType.AddGlusterServer, new AddGlusterServerVDSParameters(upServerId, newServerName));
        if (!returnValue.getSucceeded()) {
            AuditLogable logable = GlusterEventFactory.createEvent(vds, returnValue);
            auditLogDirector.log(logable, AuditLogType.GLUSTER_SERVER_ADD_FAILED);
        }
        return returnValue.getSucceeded();
    } catch (Exception e) {
        log.error("Could not peer probe the gluster server '{}': {}", vds.getHostName(), e.getMessage());
        log.debug("Exception", e);
        return false;
    }
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AddGlusterServerVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.AddGlusterServerVDSParameters) EngineException(org.ovirt.engine.core.common.errors.EngineException) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 2 with AddGlusterServerVDSParameters

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

the class ChangeVDSClusterCommand method glusterHostAdd.

private boolean glusterHostAdd(Guid targetClusterId) {
    // condition.
    try (EngineLock lock = glusterUtil.acquireGlusterLockWait(targetClusterId)) {
        VDS runningHostInTargetCluster = glusterUtil.getUpServer(targetClusterId);
        if (runningHostInTargetCluster == null) {
            log.error("Cannot add host to target cluster, no host in Up status found in target cluster");
            handleError(-1, "No host in Up status found in target cluster");
            errorType = AuditLogType.GLUSTER_SERVER_ADD_FAILED;
            return false;
        }
        VDSReturnValue returnValue = runVdsCommand(VDSCommandType.AddGlusterServer, new AddGlusterServerVDSParameters(runningHostInTargetCluster.getId(), getVds().getHostName()));
        if (!returnValue.getSucceeded()) {
            handleVdsError(returnValue);
            errorType = AuditLogType.GLUSTER_SERVER_ADD_FAILED;
            return false;
        }
        return true;
    }
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) AddGlusterServerVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.AddGlusterServerVDSParameters) EngineLock(org.ovirt.engine.core.utils.lock.EngineLock) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 3 with AddGlusterServerVDSParameters

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

the class GlusterSyncJob method glusterPeerProbeAdditionalInterface.

private boolean glusterPeerProbeAdditionalInterface(VDS upServer, String newServerName) {
    Guid upServerId = upServer.getId();
    try {
        VDSReturnValue returnValue = runVdsCommand(VDSCommandType.AddGlusterServer, new AddGlusterServerVDSParameters(upServerId, newServerName));
        if (!returnValue.getSucceeded()) {
            AuditLogable logable = GlusterEventFactory.createEvent(upServer, returnValue);
            auditLogDirector.log(logable, AuditLogType.GLUSTER_SERVER_ADD_FAILED);
        }
        return returnValue.getSucceeded();
    } catch (Exception e) {
        log.info("Exception in peer probing alernate name '{}' on host with id '{}'", newServerName, upServerId);
        log.debug("Exception", e);
        return false;
    }
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AddGlusterServerVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.AddGlusterServerVDSParameters) Guid(org.ovirt.engine.core.compat.Guid) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Aggregations

VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)3 AddGlusterServerVDSParameters (org.ovirt.engine.core.common.vdscommands.gluster.AddGlusterServerVDSParameters)3 AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)2 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 EngineException (org.ovirt.engine.core.common.errors.EngineException)1 Guid (org.ovirt.engine.core.compat.Guid)1 EngineLock (org.ovirt.engine.core.utils.lock.EngineLock)1