Search in sources :

Example 6 with StorageQos

use of org.ovirt.engine.core.common.businessentities.qos.StorageQos in project ovirt-engine by oVirt.

the class StorageQosDaoTest method getQosByDiskProfileId.

@Test
public void getQosByDiskProfileId() {
    StorageQos qos = dao.getQosByDiskProfileId(FixturesTool.DISK_PROFILE_1);
    assertNotNull(qos);
    assertEquals(FixturesTool.QOS_ID_1, qos.getId());
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos) Test(org.junit.Test)

Example 7 with StorageQos

use of org.ovirt.engine.core.common.businessentities.qos.StorageQos in project ovirt-engine by oVirt.

the class StorageQosDaoTest method generateNewEntity.

@Override
protected StorageQos generateNewEntity() {
    StorageQos storageQos = new StorageQos();
    storageQos.setId(Guid.newGuid());
    storageQos.setName("qos_d");
    storageQos.setDescription("bla bla");
    storageQos.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES);
    storageQos.setMaxThroughput(200);
    storageQos.setMaxReadThroughput(200);
    storageQos.setMaxWriteThroughput(200);
    storageQos.setMaxIops(200);
    storageQos.setMaxReadIops(200);
    storageQos.setMaxWriteIops(200);
    return storageQos;
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos)

Example 8 with StorageQos

use of org.ovirt.engine.core.common.businessentities.qos.StorageQos in project ovirt-engine by oVirt.

the class QosMapper method mapStorageQosToModel.

private static void mapStorageQosToModel(QosBase entity, Qos model) {
    StorageQos storageQos = verifyAndCast(entity, StorageQos.class);
    if (storageQos != null) {
        model.setMaxThroughput(storageQos.getMaxThroughput());
        model.setMaxReadThroughput(storageQos.getMaxReadThroughput());
        model.setMaxWriteThroughput(storageQos.getMaxWriteThroughput());
        model.setMaxIops(storageQos.getMaxIops());
        model.setMaxReadIops(storageQos.getMaxReadIops());
        model.setMaxWriteIops(storageQos.getMaxWriteIops());
    }
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos)

Example 9 with StorageQos

use of org.ovirt.engine.core.common.businessentities.qos.StorageQos in project ovirt-engine by oVirt.

the class VmSlaPolicyCommandTest method testStorageQosUnlimited.

@Test
public void testStorageQosUnlimited() {
    parameters.getStorageQos().put(diskImage, new StorageQos());
    vdsFunction = params -> {
        assertIoTune(params.getIoTuneList().get(0), 0, 0, 0, 0, 0, 0);
        return true;
    };
    assertTrue(command.validate());
    command.executeCommand();
    assertTrue(command.getReturnValue().getSucceeded());
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos) Test(org.junit.Test)

Example 10 with StorageQos

use of org.ovirt.engine.core.common.businessentities.qos.StorageQos in project ovirt-engine by oVirt.

the class LibvirtVmXmlBuilder method writeIoTune.

private void writeIoTune(DiskImage diskImage) {
    if (!qosCache.containsKey(diskImage.getDiskProfileId())) {
        qosCache.put(diskImage.getDiskProfileId(), vmInfoBuildUtils.loadStorageQos(diskImage));
    }
    StorageQos storageQos = qosCache.get(diskImage.getDiskProfileId());
    if (storageQos == null) {
        return;
    }
    writer.writeStartElement("iotune");
    ioTuneListFrom(storageQos).forEach(pair -> writer.writeAttributeString(pair.getFirst(), pair.getSecond().toString()));
    writer.writeEndElement();
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos)

Aggregations

StorageQos (org.ovirt.engine.core.common.businessentities.qos.StorageQos)17 Map (java.util.Map)4 Test (org.junit.Test)4 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)4 Guid (org.ovirt.engine.core.compat.Guid)4 HashMap (java.util.HashMap)3 List (java.util.List)3 VmSlaPolicyParameters (org.ovirt.engine.core.common.action.VmSlaPolicyParameters)2 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 Set (java.util.Set)1 Callable (java.util.concurrent.Callable)1 Collectors (java.util.stream.Collectors)1 Observes (javax.enterprise.event.Observes)1 Instance (javax.enterprise.inject.Instance)1 Inject (javax.inject.Inject)1