Skip to content

Commit

Permalink
scheduling: filter numa-less hosts to resize vms
Browse files Browse the repository at this point in the history
When having `Resize and Pin NUMA` VM that tries to schedule on a host,
it shouldn't run on a host without NUMA support.
This patch filter these host in the above scenario.

Change-Id: I41ae6d54625a2c14b749f6393c29059cbd53a6d7
Bug-Url: https://bugzilla.redhat.com/2056950
Signed-off-by: Liran Rotenberg <lrotenbe@redhat.com>
  • Loading branch information
liranr23 committed Jun 23, 2022
1 parent 470730c commit 10bff8e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public NumaPolicyUnit(PolicyUnit policyUnit,
@Override
public List<VDS> filter(SchedulingContext context, List<VDS> hosts, List<VM> vmGroup, PerHostMessages messages) {
boolean vmNumaPinned = vmGroup.stream()
.flatMap(vm -> vm.getvNumaNodeList().stream())
.anyMatch(node -> !node.getVdsNumaNodeList().isEmpty());
.anyMatch(vm -> vm.getvNumaNodeList().stream().anyMatch(node -> !node.getVdsNumaNodeList().isEmpty())
|| VmCpuCountHelper.isResizeAndPinPolicy(vm));

// If no VM numa node is pinned, all hosts are accepted.
//
Expand All @@ -49,7 +49,7 @@ public List<VDS> filter(SchedulingContext context, List<VDS> hosts, List<VM> vmG
}

List<VM> vmsToCheck = vmGroup.stream()
.filter(vm -> !vm.getvNumaNodeList().isEmpty())
.filter(vm -> !vm.getvNumaNodeList().isEmpty() || VmCpuCountHelper.isResizeAndPinPolicy(vm))
.collect(Collectors.toList());

if (vmsToCheck.isEmpty()) {
Expand Down

0 comments on commit 10bff8e

Please sign in to comment.