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());
}
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;
}
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());
}
}
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());
}
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();
}
Aggregations