use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters in project ovirt-engine by oVirt.
the class DeleteAllGlusterVolumeSnapshotsCommand method deleteAllGlusterVolumeSnapshots.
private boolean deleteAllGlusterVolumeSnapshots(Guid serverId, String volumeName, List<GlusterVolumeSnapshotEntity> snapshotsList) {
VDSReturnValue retVal = runVdsCommand(VDSCommandType.DeleteAllGlusterVolumeSnapshots, new GlusterVolumeVDSParameters(serverId, volumeName));
setSucceeded(retVal.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_ALL_SNAPSHOTS_DELETE_FAILED, retVal.getVdsError().getMessage());
} else {
List<Guid> guids = new ArrayList<>();
for (GlusterVolumeSnapshotEntity snapshot : snapshotsList) {
guids.add(snapshot.getId());
}
glusterVolumeSnapshotDao.removeAll(guids);
}
return true;
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters 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.gluster.GlusterVolumeVDSParameters in project ovirt-engine by oVirt.
the class StopGlusterVolumeProfileCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopGlusterVolumeProfile, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName()));
setSucceeded(returnValue.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_PROFILE_STOP_FAILED, returnValue.getVdsError().getMessage());
}
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters in project ovirt-engine by oVirt.
the class StopRebalanceGlusterVolumeCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue vdsReturnaValue = runVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName()));
if (!vdsReturnaValue.getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError().getMessage());
setSucceeded(false);
return;
}
GlusterVolumeTaskStatusEntity rebalanceStatusEntity = (GlusterVolumeTaskStatusEntity) vdsReturnaValue.getReturnValue();
JobExecutionStatus stepStatus = rebalanceStatusEntity.getStatusSummary().getStatus();
if (stepStatus != null) {
endStepJob(stepStatus, getStepMessageMap(stepStatus, glusterTaskUtils.getSummaryMessage(rebalanceStatusEntity.getStatusSummary())), glusterTaskUtils.isTaskSuccess(stepStatus));
} else {
endStepJob(JobExecutionStatus.ABORTED, getStepMessageMap(JobExecutionStatus.ABORTED, null), false);
}
releaseVolumeLock();
setSucceeded(vdsReturnaValue.getSucceeded());
getReturnValue().setActionReturnValue(rebalanceStatusEntity);
}
use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters in project ovirt-engine by oVirt.
the class DeleteGlusterVolumeCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.DeleteGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName()));
setSucceeded(returnValue.getSucceeded());
if (getSucceeded()) {
updateVolumeStatusInDb(getParameters().getVolumeId());
} else {
handleVdsError(AuditLogType.GLUSTER_VOLUME_DELETE_FAILED, returnValue.getVdsError().getMessage());
return;
}
}
Aggregations