From 09fee7559b1da49f75eb02ea7f5b56adba1055ab Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 27 Oct 2016 09:08:38 +0200 Subject: [PATCH] rebalance_lxc_containers: use cores instead of cpulimit --- PVE/Service/pvestatd.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm index 72c9dcff..c41ac1c6 100755 --- a/PVE/Service/pvestatd.pm +++ b/PVE/Service/pvestatd.pm @@ -261,9 +261,9 @@ sub rebalance_lxc_containers { $cpu_ctcount[$cpu]++ if $cpu <= @cpu_ctcount; } } else { - my $cpulimit = $conf->{cpulimit} // $cpucount; - $cpulimit = $cpucount if $cpulimit > $cpucount; - push @balanced_cts, [$vmid, $cpulimit, $cpuset]; + my $cores = $conf->{cores}; + $cores = $cpucount if !$cores || $cores > $cpucount; + push @balanced_cts, [$vmid, $cores, $cpuset]; } } @@ -285,7 +285,7 @@ sub rebalance_lxc_containers { my $new_order = {}; foreach my $bct (sort { &$ctid_sorter($a->[0], $b->[0]) } @balanced_cts) { - my ($vmid, $cpulimit, $cpuset) = @$bct; + my ($vmid, $cores, $cpuset) = @$bct; if (my $order = $persistent_container_order->{$vmid}) { $new_order->{$vmid} = $order; # copy old value @@ -301,7 +301,7 @@ sub rebalance_lxc_containers { my $newset = PVE::CpuSet->new(); - for (my $i = 0; $i < $cpulimit && $i < @cpus_by_count; ++$i) { + for (my $i = 0; $i < $cores && $i < @cpus_by_count; ++$i) { my $cpu = $cpus_by_count[$i]; $newset->insert($cpu); $cpu_ctcount[$cpu]++;