use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class GetLunsByVgIdQueryTest method setUpLunsFromDeviceList.
private static List<LUNs> setUpLunsFromDeviceList() {
List<LUNs> luns = setUpLuns(false);
for (LUNs lun : luns) {
HashMap<String, Boolean> pathsDictionary = new HashMap<>();
pathsDictionary.put(PHYSICAL_DEVICE_FIELD, true);
lun.setPathsDictionary(pathsDictionary);
}
return luns;
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class GetLunsByVgIdQueryTest method setUpLuns.
private static List<LUNs> setUpLuns(boolean withDummyLun) {
List<LUNs> luns = new ArrayList<>();
for (String GUID : GUIDS) {
LUNs lun = new LUNs();
lun.setLUNId(GUID);
luns.add(lun);
}
if (withDummyLun) {
LUNs dummyLun = new LUNs();
dummyLun.setLUNId(DUMMY_LUN_ID);
luns.add(dummyLun);
}
return luns;
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class BlockStorageDiscardFunctionalityHelperTest method testGetLunsThatBreakDiscardAfterDeleteSupportDiscardAfterDeleteBreaks.
@Test
public void testGetLunsThatBreakDiscardAfterDeleteSupportDiscardAfterDeleteBreaks() {
storageDomain.setDiscardAfterDelete(true);
LUNs lunThatBreaksDiscardSupport = createLunWithDiscardSupport(0L);
assertGetLunsThatBreakDiscardAfterDeleteSupportContainsExpectedLuns(Arrays.asList(createLunWithDiscardSupport(1024L), lunThatBreaksDiscardSupport), Collections.singletonList(lunThatBreaksDiscardSupport));
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs 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.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class BackendStorageDomainsResource method addExistingSAN.
private Response addExistingSAN(StorageDomain model, StorageType storageType, Guid hostId) {
getEntity(VDS.class, QueryType.GetVdsByVdsId, new IdQueryParameters(hostId), "Host: id=" + hostId);
List<LUNs> existingLuns = getDeviceList(hostId, storageType);
List<StorageServerConnections> existingStorageServerConnections = getLunsWithInitializedStorageType(existingLuns, storageType);
List<org.ovirt.engine.core.common.businessentities.StorageDomain> existingStorageDomains = getExistingBlockStorageDomain(hostId, storageType, existingStorageServerConnections);
StorageDomainStatic storageDomainToImport = getMatchingStorageDomain(asGuid(model.getId()), existingStorageDomains);
if (storageDomainToImport == null) {
throw new WebFaultException(new WebApplicationException(), "Storage Domain id " + model.getId() + " Does not exists", Status.NOT_FOUND);
}
StorageDomainMapper.map(model, storageDomainToImport);
StorageDomainManagementParameter parameters = new StorageDomainManagementParameter(storageDomainToImport);
parameters.setVdsId(hostId);
return performCreate(ActionType.AddExistingBlockStorageDomain, parameters, ID_RESOLVER);
}
Aggregations