Search in sources :

Example 6 with LogicalUnits

use of org.ovirt.engine.api.model.LogicalUnits in project ovirt-engine by oVirt.

the class BackendStorageDomainsResource method mapVolumeGroupIscsi.

protected void mapVolumeGroupIscsi(StorageDomain model, org.ovirt.engine.core.common.businessentities.StorageDomain entity) {
    VolumeGroup vg = model.getStorage().getVolumeGroup();
    List<LUNs> luns = getLunsByVgId(vg.getId());
    if (luns != null && !luns.isEmpty()) {
        vg.setLogicalUnits(new LogicalUnits());
        for (LUNs lun : luns) {
            List<StorageServerConnections> lunConnections = lun.getLunConnections();
            if (lunConnections != null) {
                for (StorageServerConnections cnx : lunConnections) {
                    LogicalUnit unit = map(lun);
                    unit = map(cnx, unit);
                    vg.getLogicalUnits().getLogicalUnits().add(unit);
                }
            }
        }
    }
}
Also used : LogicalUnits(org.ovirt.engine.api.model.LogicalUnits) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) VolumeGroup(org.ovirt.engine.api.model.VolumeGroup) LogicalUnit(org.ovirt.engine.api.model.LogicalUnit) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs)

Example 7 with LogicalUnits

use of org.ovirt.engine.api.model.LogicalUnits in project ovirt-engine by oVirt.

the class BackendVmDisksResourceTest method createIscsiLunDisk.

private Disk createIscsiLunDisk() {
    Disk model = getModel();
    model.setLunStorage(new HostStorage());
    model.getLunStorage().setType(StorageType.ISCSI);
    model.getLunStorage().setLogicalUnits(new LogicalUnits());
    model.getLunStorage().getLogicalUnits().getLogicalUnits().add(new LogicalUnit());
    model.getLunStorage().getLogicalUnits().getLogicalUnits().get(0).setId(GUIDS[0].toString());
    model.getLunStorage().getLogicalUnits().getLogicalUnits().get(0).setAddress(ISCSI_SERVER_ADDRESS);
    model.getLunStorage().getLogicalUnits().getLogicalUnits().get(0).setTarget(ISCSI_SERVER_TARGET);
    model.getLunStorage().getLogicalUnits().getLogicalUnits().get(0).setPort(ISCSI_SERVER_CONNECTION_PORT);
    model.setProvisionedSize(null);
    return model;
}
Also used : LogicalUnits(org.ovirt.engine.api.model.LogicalUnits) LogicalUnit(org.ovirt.engine.api.model.LogicalUnit) HostStorage(org.ovirt.engine.api.model.HostStorage) Disk(org.ovirt.engine.api.model.Disk)

Example 8 with LogicalUnits

use of org.ovirt.engine.api.model.LogicalUnits in project ovirt-engine by oVirt.

the class BackendStorageDomainsResource method mapVolumeGroupFcp.

protected void mapVolumeGroupFcp(StorageDomain model, org.ovirt.engine.core.common.businessentities.StorageDomain entity) {
    VolumeGroup vg = model.getStorage().getVolumeGroup();
    List<LUNs> luns = getLunsByVgId(vg.getId());
    if (luns != null && !luns.isEmpty()) {
        vg.setLogicalUnits(new LogicalUnits());
        for (LUNs lun : luns) {
            LogicalUnit unit = map(lun);
            vg.getLogicalUnits().getLogicalUnits().add(unit);
        }
    }
}
Also used : LogicalUnits(org.ovirt.engine.api.model.LogicalUnits) VolumeGroup(org.ovirt.engine.api.model.VolumeGroup) LogicalUnit(org.ovirt.engine.api.model.LogicalUnit) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs)

Example 9 with LogicalUnits

use of org.ovirt.engine.api.model.LogicalUnits in project ovirt-engine by oVirt.

the class StorageLogicalUnitMapper method map.

@Mapping(from = LUNs.class, to = HostStorage.class)
public static HostStorage map(LUNs entity, HostStorage template) {
    HostStorage model = template != null ? template : new HostStorage();
    model.setId(entity.getLUNId());
    model.setType(StorageDomainMapper.map(entity.getLunType(), null));
    model.setLogicalUnits(new LogicalUnits());
    model.getLogicalUnits().getLogicalUnits().add(map(entity, (LogicalUnit) null));
    return model;
}
Also used : LogicalUnits(org.ovirt.engine.api.model.LogicalUnits) LogicalUnit(org.ovirt.engine.api.model.LogicalUnit) HostStorage(org.ovirt.engine.api.model.HostStorage)

Aggregations

LogicalUnits (org.ovirt.engine.api.model.LogicalUnits)9 LogicalUnit (org.ovirt.engine.api.model.LogicalUnit)7 VolumeGroup (org.ovirt.engine.api.model.VolumeGroup)4 HostStorage (org.ovirt.engine.api.model.HostStorage)3 Test (org.junit.Test)2 Action (org.ovirt.engine.api.model.Action)2 LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)2 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 Disk (org.ovirt.engine.api.model.Disk)1 StorageDomain (org.ovirt.engine.api.model.StorageDomain)1 V3VolumeGroup (org.ovirt.engine.api.v3.types.V3VolumeGroup)1 ExtendSANStorageDomainParameters (org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters)1 ReduceSANStorageDomainDevicesCommandParameters (org.ovirt.engine.core.common.action.ReduceSANStorageDomainDevicesCommandParameters)1 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)1