use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class StopGeoRepSessionCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopGlusterVolumeGeoRepSession, new GlusterVolumeGeoRepSessionVDSParameters(upServer.getId(), getGeoRepSession().getMasterVolumeName(), getGeoRepSession().getSlaveHostName(), getGeoRepSession().getSlaveVolumeName(), getGeoRepSession().getUserName(), getParameters().isForce()));
setSucceeded(returnValue.getSucceeded());
if (getSucceeded()) {
getGeoRepSession().setStatus(GeoRepSessionStatus.STOPPED);
glusterGeoRepDao.updateSession(getGeoRepSession());
} else {
handleVdsError(AuditLogType.GEOREP_SESSION_STOP_FAILED, returnValue.getVdsError().getMessage());
}
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class StopGlusterVolumeCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopGlusterVolume, new GlusterVolumeActionVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().isForceAction()));
setSucceeded(returnValue.getSucceeded());
if (getSucceeded()) {
glusterDBUtils.updateVolumeStatus(getParameters().getVolumeId(), GlusterStatus.DOWN);
} else {
handleVdsError(AuditLogType.GLUSTER_VOLUME_STOP_FAILED, returnValue.getVdsError().getMessage());
return;
}
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class MergeSPMBaseCommand method executeSPMMergeCommand.
protected void executeSPMMergeCommand(VDSCommandType vdsCommandType) {
getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getSubchainInfo().getImageGroupId()));
SPMColdMergeVDSCommandParameters parameters = new SPMColdMergeVDSCommandParameters(getParameters().getStoragePoolId(), getParameters().getSubchainInfo());
VDSReturnValue vdsReturnValue = runVdsCommand(vdsCommandType, parameters);
if (vdsReturnValue.getSucceeded()) {
Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand());
getTaskIdList().add(createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId()));
setSucceeded(true);
}
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class RemoveImageCommand method executeCommand.
@Override
protected void executeCommand() {
if (getDiskImage() != null) {
try {
Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand());
VDSReturnValue vdsReturnValue = performDeleteImageVdsmOperation();
getTaskIdList().add(createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getStorageDomainId()));
} catch (EngineException e) {
if (e.getErrorCode() == EngineError.ImageDoesNotExistInDomainError) {
log.info("Disk '{}' doesn't exist on storage domain '{}', rolling forward", getDiskImage().getId(), getStorageDomainId());
} else // In this case, Engine has to check whether image still exists on the storage or not.
if (e.getErrorCode() == EngineError.ImageDeleteError && isImageRemovedFromStorage()) {
log.info("Disk '{}' was deleted from storage domain '{}'", getDiskImage().getId(), getStorageDomainId());
} else {
throw e;
}
}
if (getParameters().getParentCommand() != ActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != ActionType.RemoveVmTemplateFromImportExport) {
performImageDbOperations();
}
} else {
log.warn("DiskImage is null, nothing to remove");
}
setSucceeded(true);
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class TransferDiskImageCommand method tearDownImage.
@Override
protected void tearDownImage(Guid vdsId) {
try {
VDSReturnValue vdsRetVal = runVdsCommand(VDSCommandType.TeardownImage, getImageActionsParameters(vdsId));
if (!vdsRetVal.getSucceeded()) {
EngineException engineException = new EngineException();
engineException.setVdsError(vdsRetVal.getVdsError());
throw engineException;
}
} catch (EngineException e) {
DiskImage image = getDiskImage();
log.warn("Failed to tear down image '{}' for image transfer session: {}", image, e.getVdsError());
// Invoke log method directly rather than relying on infra, because teardown
// failure may occur during command execution, e.g. if the upload is paused.
addCustomValue("DiskAlias", image != null ? image.getDiskAlias() : "(unknown)");
auditLogDirector.log(this, AuditLogType.TRANSFER_IMAGE_TEARDOWN_FAILED);
}
}
Aggregations