use of org.ovirt.engine.core.common.businessentities.VdsNumaNode in project ovirt-engine by oVirt.
the class NumaValidator method checkVmNumaNodesIntegrity.
/**
* Check the whole numa configuration of a VM. The numa nodes for validation need to be passed in separately because
* the numa nodes are not necessarily part of the VM when the validation takes place.
*
* @param vm to check comaptiblity with
* @param vmNumaNodes to use for validation
* @return the validation result
*/
public ValidationResult checkVmNumaNodesIntegrity(final VM vm, final List<VmNumaNode> vmNumaNodes) {
if (vmNumaNodes.isEmpty()) {
return ValidationResult.VALID;
}
ValidationResult validationResult = validateVmNumaConfig(vm, vmNumaNodes);
if (!validationResult.isValid()) {
return validationResult;
}
// TODO Numa sheduling policy
if (Config.<Boolean>getValue(ConfigValues.SupportNUMAMigration)) {
return ValidationResult.VALID;
}
validationResult = validateVmPinning(vm);
if (!validationResult.isValid()) {
return validationResult;
}
final List<VdsNumaNode> hostNumaNodes = vdsNumaNodeDao.getAllVdsNumaNodeByVdsId(vm.getDedicatedVmForVdsList().get(0));
return validateNumaCompatibility(vm, vmNumaNodes, hostNumaNodes);
}
use of org.ovirt.engine.core.common.businessentities.VdsNumaNode in project ovirt-engine by oVirt.
the class HostMonitoring method saveNumaStatisticsDataToDb.
private void saveNumaStatisticsDataToDb() {
final List<VdsNumaNode> vdsNumaNodesToSave = new ArrayList<>();
List<VdsNumaNode> updateNumaNodes = vds.getNumaNodeList();
if (!updateNumaNodes.isEmpty()) {
List<VdsNumaNode> dbVdsNumaNodes = getDbFacade().getVdsNumaNodeDao().getAllVdsNumaNodeByVdsId(vds.getId());
Map<Integer, VdsNumaNode> nodesMap = new HashMap<>();
for (VdsNumaNode node : dbVdsNumaNodes) {
nodesMap.put(node.getIndex(), node);
}
for (VdsNumaNode node : updateNumaNodes) {
VdsNumaNode dbNode = nodesMap.get(node.getIndex());
if (dbNode != null) {
if (node.getNumaNodeStatistics() != null) {
dbNode.setNumaNodeStatistics(node.getNumaNodeStatistics());
vdsNumaNodesToSave.add(dbNode);
}
}
}
}
if (!vdsNumaNodesToSave.isEmpty()) {
getDbFacade().getVdsNumaNodeDao().massUpdateNumaNodeStatistics(vdsNumaNodesToSave);
}
}
Aggregations