use of org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo in project ovirt-engine by oVirt.
the class CreateOvfVolumeForStorageDomainCommand method addStorageDomainOvfInfoToDb.
private void addStorageDomainOvfInfoToDb(Guid diskId) {
StorageDomainOvfInfo storageDomainOvfInfo = new StorageDomainOvfInfo(getStorageDomainId(), null, diskId, StorageDomainOvfInfoStatus.DISABLED, null);
storageDomainOvfInfoDao.save(storageDomainOvfInfo);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo in project ovirt-engine by oVirt.
the class ProcessOvfUpdateForStorageDomainCommand method populateStorageDomainOvfData.
private void populateStorageDomainOvfData() {
List<StorageDomainOvfInfo> storageDomainOvfInfos = storageDomainOvfInfoDao.getAllForDomain(getStorageDomainId());
ovfDiskCount = storageDomainOvfInfos.size();
storageDomainOvfInfos.sort(OVF_INFO_COMPARATOR);
for (StorageDomainOvfInfo storageDomainOvfInfo : storageDomainOvfInfos) {
if (storageDomainOvfInfo.getStatus() != StorageDomainOvfInfoStatus.DISABLED) {
DiskImage ovfDisk = (DiskImage) diskDao.get(storageDomainOvfInfo.getOvfDiskId());
domainOvfStoresInfoForUpdate.add(new Pair<>(storageDomainOvfInfo, ovfDisk));
}
}
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo in project ovirt-engine by oVirt.
the class ProcessOvfUpdateForStoragePoolCommand method proccessDomainsForOvfUpdate.
protected void proccessDomainsForOvfUpdate(StoragePool pool) {
List<StorageDomain> domainsInPool = storageDomainDao.getAllForStoragePool(pool.getId());
for (StorageDomain domain : domainsInPool) {
if (!domain.getStorageDomainType().isDataDomain() || (domain.getStatus() != StorageDomainStatus.Active && getParameters().getStorageDomainId() != null && !domain.getId().equals(getParameters().getStorageDomainId()))) {
continue;
}
activeDataDomainsIds.add(domain.getId());
Integer ovfStoresCountForDomain = Config.<Integer>getValue(ConfigValues.StorageDomainOvfStoreCount);
List<StorageDomainOvfInfo> storageDomainOvfInfos = storageDomainOvfInfoDao.getAllForDomain(domain.getId());
if (storageDomainOvfInfos.size() < ovfStoresCountForDomain) {
proccessedDomains.add(domain.getId());
continue;
}
for (StorageDomainOvfInfo storageDomainOvfInfo : storageDomainOvfInfos) {
if (storageDomainOvfInfo.getStatus() == StorageDomainOvfInfoStatus.OUTDATED) {
proccessedDomains.add(storageDomainOvfInfo.getStorageDomainId());
break;
}
}
}
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo in project ovirt-engine by oVirt.
the class ProcessOvfUpdateForStoragePoolCommandTest method performStoragePoolInitOps.
private void performStoragePoolInitOps(StoragePool pool) {
executedUpdatedOvfGenerationIdsInDb = new HashMap<>();
for (int i = 0; i < 2; i++) {
Guid domainId = Guid.newGuid();
StorageDomainOvfInfo ovfInfo = new StorageDomainOvfInfo(domainId, null, null, StorageDomainOvfInfoStatus.UPDATED, null);
StorageDomain domain = new StorageDomain();
domain.setId(domainId);
domain.setStoragePoolIsoMapData(new StoragePoolIsoMap(domainId, pool.getId(), StorageDomainStatus.Active));
poolDomainsOvfInfo.put(domainId, new Pair<>(Collections.singletonList(ovfInfo), domain));
}
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo in project ovirt-engine by oVirt.
the class StorageDomainOvfInfoDaoTest method updateOvfUpdatedInfoFewDomains.
@Test
public void updateOvfUpdatedInfoFewDomains() {
StorageDomainOvfInfo ovfInfo = dao.get(getExistingEntityId());
StorageDomainOvfInfo ovfInfo1 = dao.getAllForDomain(FixturesTool.STORAGE_DOMAIN_NFS2_2).get(0);
assertNotSame("domain shouldn't be ovf updated prior to test", StorageDomainOvfInfoStatus.UPDATED, ovfInfo1.getStatus());
assertNotSame("domain shouldn't be ovf updated prior to test", StorageDomainOvfInfoStatus.UPDATED, ovfInfo.getStatus());
dao.updateOvfUpdatedInfo(Arrays.asList(ovfInfo.getStorageDomainId(), ovfInfo1.getStorageDomainId()), StorageDomainOvfInfoStatus.UPDATED, StorageDomainOvfInfoStatus.DISABLED);
ovfInfo = dao.get(ovfInfo.getOvfDiskId());
ovfInfo1 = dao.get(ovfInfo1.getOvfDiskId());
assertEquals(StorageDomainOvfInfoStatus.UPDATED, ovfInfo.getStatus());
assertEquals(StorageDomainOvfInfoStatus.UPDATED, ovfInfo1.getStatus());
}
Aggregations