Search in sources :

Example 6 with StorageDomainDynamic

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();
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) StorageDomainDynamic(org.ovirt.engine.core.common.businessentities.StorageDomainDynamic)

Example 7 with StorageDomainDynamic

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;
}
Also used : StorageDomainDynamic(org.ovirt.engine.core.common.businessentities.StorageDomainDynamic)

Example 8 with StorageDomainDynamic

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);
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StoragePoolIsoMap(org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap) StorageDomainDynamic(org.ovirt.engine.core.common.businessentities.StorageDomainDynamic) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue) Test(org.junit.Test)

Aggregations

StorageDomainDynamic (org.ovirt.engine.core.common.businessentities.StorageDomainDynamic)8 Test (org.junit.Test)3 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)3 StoragePoolIsoMap (org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap)3 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)2 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)2 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)2 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)1 StorageDomainStatus (org.ovirt.engine.core.common.businessentities.StorageDomainStatus)1 VDSType (org.ovirt.engine.core.common.businessentities.VDSType)1 VdsSpmIdMap (org.ovirt.engine.core.common.businessentities.VdsSpmIdMap)1 VdsStatic (org.ovirt.engine.core.common.businessentities.VdsStatic)1 RandomUtils (org.ovirt.engine.core.utils.RandomUtils)1