use of org.ovirt.engine.core.common.errors.EngineFault in project ovirt-engine by oVirt.
the class RemoveCinderVolumeParentCommand method handleExecutionFailure.
protected void handleExecutionFailure(CinderDisk disk, ActionReturnValue actionReturnValue) {
log.error("Failed to remove cider volume id '{}' for disk id '{}'.", disk.getImageId(), disk.getId());
EngineFault fault = actionReturnValue == null ? new EngineFault() : actionReturnValue.getFault();
getReturnValue().setFault(fault);
}
use of org.ovirt.engine.core.common.errors.EngineFault in project ovirt-engine by oVirt.
the class ActionReturnValue method getFault.
public EngineFault getFault() {
if (fault == null) {
fault = new EngineFault();
fault.setError(EngineError.ENGINE);
fault.setMessage(EngineError.ENGINE.name());
}
return fault;
}
use of org.ovirt.engine.core.common.errors.EngineFault in project ovirt-engine by oVirt.
the class HotSetAmountOfMemoryCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.SetAmountOfMemory, new SetAmountOfMemoryVDSCommand.Params(getVm().getRunOnVds(), getVm().getId(), createMemoryDevice(), getParameters().getVmStaticData().getMinAllocatedMem()));
if (vdsReturnValue.getSucceeded()) {
setSucceeded(true);
} else {
EngineFault fault = new EngineFault();
fault.setError(vdsReturnValue.getVdsError().getCode());
fault.setMessage(vdsReturnValue.getVdsError().getMessage());
getReturnValue().setFault(fault);
}
}
use of org.ovirt.engine.core.common.errors.EngineFault in project ovirt-engine by oVirt.
the class HotUnplugMemoryCommandBase method setReturnValueFailure.
private void setReturnValueFailure(VDSReturnValue returnValueFailure) {
final EngineFault engineFault = new EngineFault();
engineFault.setError(returnValueFailure.getVdsError().getCode());
engineFault.setMessage(returnValueFailure.getVdsError().getMessage());
getReturnValue().setFault(engineFault);
}
use of org.ovirt.engine.core.common.errors.EngineFault in project ovirt-engine by oVirt.
the class ISCSIStorageHelper method runConnectionStorageToDomain.
@SuppressWarnings("unchecked")
@Override
protected Pair<Boolean, EngineFault> runConnectionStorageToDomain(StorageDomain storageDomain, Guid vdsId, int type, LUNs lun, Guid storagePoolId) {
boolean isSuccess = true;
VDSReturnValue returnValue = null;
List<StorageServerConnections> list = (lun == null) ? storageServerConnectionDao.getAllForVolumeGroup(storageDomain.getStorage()) : lun.getLunConnections();
if (list.size() != 0) {
if (VDSCommandType.forValue(type) == VDSCommandType.DisconnectStorageServer) {
list = filterConnectionsUsedByOthers(list, storageDomain.getStorage(), lun != null ? lun.getLUNId() : "");
} else if (VDSCommandType.forValue(type) == VDSCommandType.ConnectStorageServer) {
list = updateIfaces(list, vdsId);
}
Guid poolId = storagePoolId;
if (storageDomain != null && storageDomain.getStoragePoolId() != null) {
poolId = storageDomain.getStoragePoolId();
}
returnValue = backend.getResourceManager().runVdsCommand(VDSCommandType.forValue(type), new StorageServerConnectionManagementVDSParameters(vdsId, poolId, StorageType.ISCSI, list));
isSuccess = returnValue.getSucceeded();
if (isSuccess && VDSCommandType.forValue(type) == VDSCommandType.ConnectStorageServer) {
isSuccess = isConnectSucceeded((Map<String, String>) returnValue.getReturnValue(), list);
}
}
EngineFault engineFault = null;
if (!isSuccess && returnValue.getVdsError() != null) {
engineFault = new EngineFault();
engineFault.setError(returnValue.getVdsError().getCode());
}
return new Pair<>(isSuccess, engineFault);
}
Aggregations