Search in sources :

Example 6 with EngineFault

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);
}
Also used : EngineFault(org.ovirt.engine.core.common.errors.EngineFault)

Example 7 with EngineFault

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;
}
Also used : EngineFault(org.ovirt.engine.core.common.errors.EngineFault)

Example 8 with EngineFault

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);
    }
}
Also used : EngineFault(org.ovirt.engine.core.common.errors.EngineFault) SetAmountOfMemoryVDSCommand(org.ovirt.engine.core.vdsbroker.SetAmountOfMemoryVDSCommand) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 9 with EngineFault

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);
}
Also used : EngineFault(org.ovirt.engine.core.common.errors.EngineFault)

Example 10 with 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);
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageServerConnectionManagementVDSParameters(org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters) EngineFault(org.ovirt.engine.core.common.errors.EngineFault) Guid(org.ovirt.engine.core.compat.Guid) Map(java.util.Map) LUNStorageServerConnectionMap(org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue) Pair(org.ovirt.engine.core.common.utils.Pair)

Aggregations

EngineFault (org.ovirt.engine.core.common.errors.EngineFault)20 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)6 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)6 Test (org.junit.Test)4 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)4 Pair (org.ovirt.engine.core.common.utils.Pair)3 ArrayList (java.util.ArrayList)2 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)2 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)2 EngineException (org.ovirt.engine.core.common.errors.EngineException)2 StorageServerConnectionManagementVDSParameters (org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters)2 Guid (org.ovirt.engine.core.compat.Guid)2 Map (java.util.Map)1 StorageServerConnectionParametersBase (org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase)1 StoragePoolIsoMap (org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 LUNStorageServerConnectionMap (org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap)1 Event (org.ovirt.engine.core.common.eventqueue.Event)1 EventResult (org.ovirt.engine.core.common.eventqueue.EventResult)1 DestroyImageVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.DestroyImageVDSCommandParameters)1