Search in sources :

Example 81 with LUNs

use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.

the class AddExistingBlockStorageDomainCommand method getLUNsFromVgInfo.

protected List<LUNs> getLUNsFromVgInfo() {
    List<LUNs> luns = new ArrayList<>();
    VDSReturnValue returnValue;
    try {
        returnValue = runVdsCommand(VDSCommandType.GetVGInfo, new GetVGInfoVDSCommandParameters(getParameters().getVdsId(), getStorageDomain().getStorage()));
    } catch (RuntimeException e) {
        log.error("Could not get info for VG ID '{}': {}", getStorageDomain().getStorage(), e.getMessage());
        log.debug("Exception", e);
        return luns;
    }
    luns.addAll((ArrayList<LUNs>) returnValue.getReturnValue());
    return luns;
}
Also used : GetVGInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.GetVGInfoVDSCommandParameters) ArrayList(java.util.ArrayList) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 82 with LUNs

use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.

the class ExtendSANStorageDomainCommand method executeCommand.

@Override
protected void executeCommand() {
    executeInNewTransaction(() -> {
        setStorageDomainStatus(StorageDomainStatus.Locked, getCompensationContext());
        getCompensationContext().stateChanged();
        return null;
    });
    runVdsCommand(VDSCommandType.ExtendStorageDomain, new ExtendStorageDomainVDSCommandParameters(getStoragePoolId(), getStorageDomain().getId(), getParameters().getLunIds(), getParameters().isForce()));
    updateLunsList();
    executeInNewTransaction(() -> {
        for (LUNs lun : getParameters().getLunsList()) {
            lunHelper.proceedLUNInDb(lun, getStorageDomain().getStorageType(), getStorageDomain().getStorage());
        }
        setStorageDomainStatus(StorageDomainStatus.Active, null);
        getCompensationContext().cleanupCompensationDataAfterSuccessfulCommand();
        return null;
    });
    setSucceeded(true);
}
Also used : LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) ExtendStorageDomainVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.ExtendStorageDomainVDSCommandParameters)

Example 83 with LUNs

use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.

the class DiskValidatorTest method createLunDisk.

private static LunDisk createLunDisk() {
    LunDisk disk = new LunDisk();
    LUNs lun = new LUNs();
    lun.setLUNId("lun_id");
    lun.setLunType(StorageType.ISCSI);
    disk.setLun(lun);
    return disk;
}
Also used : LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs)

Example 84 with LUNs

use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.

the class BackendHostStorageResourceTest method getEntity.

@Override
protected LUNs getEntity(int index) {
    LUNs entity = new LUNs();
    entity.setLUNId(GUIDS[index].toString());
    entity.setLunType(org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI);
    return entity;
}
Also used : LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs)

Example 85 with LUNs

use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.

the class SanStorageModelBase method getPartOfSdLunsMessages.

public ArrayList<String> getPartOfSdLunsMessages() {
    ArrayList<String> partOfSdLunsMessages = new ArrayList<>();
    UIMessages messages = ConstantsManager.getInstance().getMessages();
    for (LunModel lunModel : getAddedLuns()) {
        LUNs lun = lunModel.getEntity();
        if (lun.getStorageDomainId() != null) {
            String reason = messages.lunAlreadyPartOfStorageDomainWarning(lun.getStorageDomainName());
            // $NON-NLS-1$ //$NON-NLS-2$
            partOfSdLunsMessages.add(lunModel.getLunId() + " (" + reason + ")");
        }
    }
    return partOfSdLunsMessages;
}
Also used : UIMessages(org.ovirt.engine.ui.uicompat.UIMessages) ArrayList(java.util.ArrayList) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs)

Aggregations

LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)105 ArrayList (java.util.ArrayList)40 Test (org.junit.Test)33 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)26 Guid (org.ovirt.engine.core.compat.Guid)18 BaseCommandTest (org.ovirt.engine.core.bll.BaseCommandTest)17 List (java.util.List)16 HashMap (java.util.HashMap)14 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)13 LunDisk (org.ovirt.engine.core.common.businessentities.storage.LunDisk)13 VDS (org.ovirt.engine.core.common.businessentities.VDS)12 VM (org.ovirt.engine.core.common.businessentities.VM)7 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)7 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)7 Map (java.util.Map)6 LUNStorageServerConnectionMap (org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap)6 LogicalUnit (org.ovirt.engine.api.model.LogicalUnit)5 Pair (org.ovirt.engine.core.common.utils.Pair)5 GetDeviceListVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters)5 HashSet (java.util.HashSet)4