use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters in project ovirt-engine by oVirt.
the class CommitRemoveGlusterVolumeBricksCommand method executeCommand.
@Override
protected void executeCommand() {
GlusterVolumeEntity volume = getGlusterVolume();
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.CommitRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), getParameters().getBricks()));
setSucceeded(returnValue.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_COMMIT_FAILED, returnValue.getVdsError().getMessage());
return;
}
addCustomValue(GlusterConstants.NO_OF_BRICKS, String.valueOf(getParameters().getBricks().size()));
endStepJobCommitted();
glusterDBUtils.removeBricksFromVolumeInDb(volume, getParameters().getBricks(), getParameters().getReplicaCount());
glusterVolumeDao.updateVolumeTask(volume.getId(), null);
releaseVolumeLock();
getReturnValue().setActionReturnValue(returnValue.getReturnValue());
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters in project ovirt-engine by oVirt.
the class GlusterVolumeRemoveBricksCommand method executeCommand.
@Override
protected void executeCommand() {
int replicaCount = (getGlusterVolume().getVolumeType() == GlusterVolumeType.REPLICATE || getGlusterVolume().getVolumeType() == GlusterVolumeType.DISTRIBUTED_REPLICATE) ? getParameters().getReplicaCount() : 0;
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StartRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getBricks(), replicaCount, true));
setSucceeded(returnValue.getSucceeded());
if (getSucceeded()) {
glusterDBUtils.removeBricksFromVolumeInDb(getGlusterVolume(), getParameters().getBricks(), replicaCount);
} else {
handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_FAILED, returnValue.getVdsError().getMessage());
return;
}
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters 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());
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters in project ovirt-engine by oVirt.
the class GetGlusterVolumeRemoveBricksStatusQuery method fetchTaskStatusDetails.
@Override
protected GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRemoveBricksStatus, new GlusterVolumeRemoveBricksVDSParameters(getUpServerId(clusterId), volume.getName(), getParameters().getBricks(), volume.getReplicaCount()));
GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue();
// Update the latest status details
GlusterAsyncTask asyncTask = volume.getAsyncTask();
if (asyncTask != null) {
// take a copy of the task status with engine for further use
JobExecutionStatus jobStatusWithEngine = volume.getAsyncTask().getStatus();
// update the status entity with required details
updateStatusEntity(entity);
// be set to aborted. This is required only in case of remove bricks
if (jobStatusWithEngine == JobExecutionStatus.ABORTED) {
entity.getStatusSummary().setStatus(JobExecutionStatus.ABORTED);
}
}
return entity;
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters in project ovirt-engine by oVirt.
the class StopRemoveGlusterVolumeBricksCommand method executeCommand.
@Override
protected void executeCommand() {
GlusterVolumeEntity volume = getGlusterVolume();
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), getParameters().getBricks()));
setSucceeded(returnValue.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_FAILED, returnValue.getVdsError().getMessage());
return;
}
GlusterVolumeTaskStatusEntity rebalanceStatusEntity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue();
endStepJobAborted(glusterTaskUtils.getSummaryMessage(rebalanceStatusEntity.getStatusSummary()));
releaseVolumeLock();
getReturnValue().setActionReturnValue(rebalanceStatusEntity);
}
Aggregations