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);
}
}
}
}
}
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;
}
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);
}
}
}
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;
}
Aggregations