use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class SetupGlusterGeoRepMountBrokerInternalCommand method restartGlusterd.
private VDSReturnValue restartGlusterd(Guid serverId) {
getCustomValues().put(GlusterConstants.VDS_NAME, vdsDao.get(serverId).getName());
GlusterServiceVDSParameters params = new GlusterServiceVDSParameters(serverId, Collections.singletonList("glusterd"), GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART);
VDSReturnValue restartGlusterdReturnValue = runVdsCommand(VDSCommandType.ManageGlusterService, params);
return restartGlusterdReturnValue;
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class SetupGlusterGeoRepMountBrokerInternalCommand method executeCommand.
@Override
protected void executeCommand() {
boolean succeeded = true;
final SetUpMountBrokerParameters parameters = getParameters();
final List<Callable<VDSReturnValue>> mountBrokerSetupReturnStatuses = new ArrayList<>();
for (final Guid currentRemoteServerId : getParameters().getRemoteServerIds()) {
mountBrokerSetupReturnStatuses.add(() -> setUpMountBrokerPartial(currentRemoteServerId, parameters.getRemoteUserName(), parameters.getRemoteUserGroup(), parameters.getRemoteVolumeName(), parameters.isPartial()));
}
List<VDSReturnValue> returnValues = ThreadPoolUtil.invokeAll(mountBrokerSetupReturnStatuses);
List<String> errors = new ArrayList<>();
for (VDSReturnValue currentReturnValue : returnValues) {
if (!currentReturnValue.getSucceeded()) {
succeeded = false;
errors.add(currentReturnValue.getVdsError().getMessage());
}
}
if (!errors.isEmpty()) {
propagateFailure(AuditLogType.GLUSTER_GEOREP_SETUP_MOUNT_BROKER_FAILED, errors);
}
setSucceeded(succeeded);
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class StartGlusterVolumeProfileCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StartGlusterVolumeProfile, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName()));
setSucceeded(returnValue.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_PROFILE_START_FAILED, returnValue.getVdsError().getMessage());
}
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class StartRebalanceGlusterVolumeCommand method executeCommand.
@Override
protected void executeCommand() {
startSubStep();
VDSReturnValue taskReturn = runVdsCommand(VDSCommandType.StartRebalanceGlusterVolume, new GlusterVolumeRebalanceVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().isFixLayoutOnly(), getParameters().isForceAction()));
setSucceeded(taskReturn.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_START_FAILED, taskReturn.getVdsError().getMessage());
return;
}
GlusterAsyncTask glusterTask = (GlusterAsyncTask) taskReturn.getReturnValue();
handleTaskReturn(glusterTask);
updateVolumeWithTaskID(glusterTask);
getReturnValue().setActionReturnValue(glusterTask);
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class StartRemoveGlusterVolumeBricksCommand method executeCommand.
@Override
protected void executeCommand() {
int replicaCount = getGlusterVolume().getVolumeType().isReplicatedType() ? getParameters().getReplicaCount() : 0;
startSubStep();
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StartRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getBricks(), replicaCount, false));
setSucceeded(returnValue.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED, returnValue.getVdsError().getMessage());
return;
}
GlusterAsyncTask glusterTask = (GlusterAsyncTask) returnValue.getReturnValue();
handleTaskReturn(glusterTask);
updateBricksWithTaskID(glusterTask);
getReturnValue().setActionReturnValue(returnValue.getReturnValue());
}
Aggregations