use of org.ovirt.engine.core.common.businessentities.StorageDomainDynamic in project ovirt-engine by oVirt.
the class AbstractOpenStackStorageProviderProxy method addStorageDomain.
protected Guid addStorageDomain(StorageType storageType, StorageDomainType storageDomainType) {
// Storage domain static
StorageDomainStatic domainStaticEntry = new StorageDomainStatic();
domainStaticEntry.setId(Guid.newGuid());
domainStaticEntry.setStorage(provider.getId().toString());
domainStaticEntry.setStorageName(provider.getName());
domainStaticEntry.setDescription(provider.getDescription());
domainStaticEntry.setStorageFormat(StorageFormatType.V1);
domainStaticEntry.setStorageType(storageType);
domainStaticEntry.setStorageDomainType(storageDomainType);
domainStaticEntry.setWipeAfterDelete(false);
domainStaticEntry.setDiscardAfterDelete(false);
getDbFacade().getStorageDomainStaticDao().save(domainStaticEntry);
// Storage domain dynamic
StorageDomainDynamic domainDynamicEntry = new StorageDomainDynamic();
domainDynamicEntry.setId(domainStaticEntry.getId());
getDbFacade().getStorageDomainDynamicDao().save(domainDynamicEntry);
return domainStaticEntry.getId();
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainDynamic in project ovirt-engine by oVirt.
the class StorageDomainDynamicDaoTest method generateNewEntity.
@Override
protected StorageDomainDynamic generateNewEntity() {
StorageDomainDynamic newDynamicDomain = new StorageDomainDynamic();
newDynamicDomain.setId(FixturesTool.STORAGE_DOMAIN_NFS2_2);
newDynamicDomain.setAvailableDiskSize(USED_DISK_SIZE);
return newDynamicDomain;
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainDynamic in project ovirt-engine by oVirt.
the class UpdateStorageServerConnectionCommandTest method failUpdateStats.
@Test
public void failUpdateStats() {
StorageServerConnections newNFSConnection = createNFSConnection("multipass.my.domain.tlv.company.com:/export/allstorage/data2", StorageType.NFS, NfsVersion.V4, 300, 0);
parameters.setStorageServerConnection(newNFSConnection);
VDSReturnValue returnValueUpdate = new VDSReturnValue();
returnValueUpdate.setSucceeded(false);
StorageDomain domain = createDomain();
initDomainListForConnection(newNFSConnection.getId(), domain);
StorageDomainDynamic domainDynamic = new StorageDomainDynamic();
StoragePoolIsoMap map = new StoragePoolIsoMap();
doReturn(Collections.singletonList(map)).when(command).getStoragePoolIsoMap(domain);
doReturn(returnValueUpdate).when(command).getStatsForDomain(domain);
doReturn(true).when(command).connectToStorage();
doNothing().when(command).changeStorageDomainStatusInTransaction(StorageDomainStatus.Locked);
doNothing().when(command).disconnectFromStorage();
command.executeCommand();
CommandAssertUtils.checkSucceeded(command, true);
verify(storageDomainDynamicDao, never()).update(domainDynamic);
}
Aggregations