use of org.ovirt.engine.core.common.businessentities.qos.CpuQos in project ovirt-engine by oVirt.
the class UpdateCpuProfileCommand method executeCommand.
@Override
protected void executeCommand() {
// Chcek if qos has changed
Guid oldQos = cpuProfileDao.get(getProfileId()).getQosId();
Guid newQos = getProfile().getQosId();
super.executeCommand();
// QoS did not change
if (Objects.equals(oldQos, newQos)) {
return;
}
CpuQos qos;
if (newQos == null || Guid.Empty.equals(newQos)) {
qos = new CpuQos();
qos.setCpuLimit(100);
} else {
qos = cpuQosDao.get(newQos);
}
// Update policies of all running vms
if (getSucceeded()) {
vmSlaPolicyUtils.refreshRunningVmsWithCpuProfile(getProfileId(), qos);
}
}
use of org.ovirt.engine.core.common.businessentities.qos.CpuQos in project ovirt-engine by oVirt.
the class CpuQosDaoTest method generateNewEntity.
@Override
protected CpuQos generateNewEntity() {
CpuQos cpuQos = new CpuQos();
cpuQos.setId(Guid.newGuid());
cpuQos.setName("qos_d");
cpuQos.setDescription("desc3");
cpuQos.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES);
cpuQos.setCpuLimit(40);
return cpuQos;
}
use of org.ovirt.engine.core.common.businessentities.qos.CpuQos in project ovirt-engine by oVirt.
the class QosRangeValidatorTest method validCpuMessage.
@Test
public void validCpuMessage() {
CpuQos qos = new CpuQos();
qos.setCpuLimit(OUT_OF_RANGE);
List<String> validationMessages = ValidationUtils.validateInputs(Arrays.asList(new Class<?>[] { Default.class }), qos);
assertValidateMsgCount(validationMessages, "$range 1-100", 1);
assertValidateMsgCount(validationMessages, EngineMessage.ACTION_TYPE_FAILED_QOS_OUT_OF_RANGE_VALUES.name(), 1);
}
Aggregations