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;
}
}
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;
}
}
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;
}
}
Aggregations