use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class AbstractSyncStorageDomainsLunsCommandTest method setUp.
@Before
public void setUp() {
blockSd1Id = Guid.newGuid();
String sd1Name = "vg1";
blockSd1 = new StorageDomain();
blockSd1.setId(blockSd1Id);
blockSd1.setStorageType(StorageType.ISCSI);
blockSd1.setStatus(StorageDomainStatus.Active);
blockSd1.setStorage(sd1Name);
blockSd1Lun1 = new LUNs();
blockSd1Lun1.setId("blockSd1Lun1");
blockSd1Lun1.setVolumeGroupId(sd1Name);
blockSd1Lun1.setStorageDomainId(blockSd1Id);
blockSd2Id = Guid.newGuid();
String sd2Name = "vg2";
blockSd2 = new StorageDomain();
blockSd2.setId(blockSd2Id);
blockSd2.setStorageType(StorageType.FCP);
blockSd2.setStatus(StorageDomainStatus.Active);
blockSd2.setStorage(sd2Name);
blockSd2Lun1 = new LUNs();
blockSd2Lun1.setId("blockSd2Lun1");
blockSd2Lun2 = new LUNs();
blockSd2Lun2.setId("blockSd2Lun2");
blockSd2Lun1.setVolumeGroupId(sd2Name);
blockSd2Lun1.setStorageDomainId(blockSd2Id);
blockSd2Lun2.setVolumeGroupId(sd2Name);
blockSd2Lun2.setStorageDomainId(blockSd2Id);
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class SyncDirectLunsCommandTest method setUp.
@Before
public void setUp() {
lun1 = new LUNs();
lun1.setLUNId("lun1");
lun1.setDiskId(Guid.newGuid());
lun1.setVolumeGroupId("");
disk1Lun1Map = new DiskLunMap(lun1.getDiskId(), lun1.getLUNId());
lun2 = new LUNs();
lun2.setLUNId("lun2");
lun2.setDiskId(Guid.newGuid());
lun2.setVolumeGroupId("");
lun3 = new LUNs();
lun3.setLUNId("lun3");
lun3.setDiskId(Guid.newGuid());
lun3.setVolumeGroupId("");
mockLunDao();
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class BackendStorageDomainsResourceTest method setUpLuns.
protected List<LUNs> setUpLuns() {
StorageServerConnections cnx = new StorageServerConnections();
cnx.setConnection(ADDRESSES[0]);
cnx.setIqn(TARGET);
cnx.setPort(Integer.toString(PORT));
LUNs lun = new LUNs();
lun.setLUNId(LUN);
lun.setLunConnections(new ArrayList<>());
lun.getLunConnections().add(cnx);
List<LUNs> luns = new ArrayList<>();
luns.add(lun);
return luns;
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class BackendStorageDomainsResourceTest method testAddIscsiStorageDomainAssumingConnection.
@Test
public void testAddIscsiStorageDomainAssumingConnection() throws Exception {
StorageDomain model = getIscsi();
Host host = new Host();
host.setId(GUIDS[0].toString());
model.setHost(host);
for (LogicalUnit lun : model.getStorage().getVolumeGroup().getLogicalUnits().getLogicalUnits()) {
lun.setAddress(null);
lun.setTarget(null);
}
setUriInfo(setUpBasicUriExpectations());
setUpGetEntityExpectations(QueryType.GetDeviceList, GetDeviceListQueryParameters.class, new String[] { "Id", "StorageType" }, new Object[] { GUIDS[0], org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI }, "this return value isn't used");
List<LUNs> luns = setUpLuns();
setUpGetEntityExpectations(QueryType.GetLunsByVgId, GetLunsByVgIdParameters.class, new String[] { "VgId" }, new Object[] { GUIDS[GUIDS.length - 1].toString() }, luns);
setUpCreationExpectations(ActionType.AddSANStorageDomain, AddSANStorageDomainParameters.class, new String[] { "VdsId" }, new Object[] { GUIDS[0] }, true, true, GUIDS[0], QueryType.GetStorageDomainById, IdQueryParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, getIscsiEntity());
Response response = collection.add(model);
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof StorageDomain);
verifyIscsi((StorageDomain) response.getEntity());
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class SanStorageModelBase method updateInternal.
protected void updateInternal() {
if (!(getContainer().isNewStorage() || getContainer().isStorageActive())) {
return;
}
VDS host = getContainer().getHost().getSelectedItem();
if (host == null) {
proposeDiscover();
return;
}
final Collection<EntityModel<?>> prevSelected = Linq.findSelectedItems((Collection<EntityModel<?>>) getSelectedItem());
clearItems();
initializeItems(null, null);
final SanStorageModelBase model = this;
AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<>(response -> {
if (response.getSucceeded()) {
setValuesForMaintenance(model);
model.applyData((ArrayList<LUNs>) response.getReturnValue(), false, prevSelected, isInMaintenance, metadata);
model.initLunSelection();
// $NON-NLS-1$
model.setGetLUNsFailure("");
model.stopProgress();
} else {
model.setGetLUNsFailure(ConstantsManager.getInstance().getConstants().couldNotRetrieveLUNsLunsFailure());
}
}, true);
Frontend.getInstance().runQuery(QueryType.GetDeviceList, new GetDeviceListQueryParameters(host.getId(), getType(), false, null, false), asyncQuery);
getContainer().startProgress();
}
Aggregations