Skip to content

Commit

Permalink
fix: Don't count 2 times LXC cgroups cpus
Browse files Browse the repository at this point in the history
Closes #464
  • Loading branch information
g-bougard committed Sep 4, 2023
1 parent 3acd88f commit 05e6510
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ core:
inventory:
* Fix inventory failure due to Oracle database inventory on win32
* Fix AMD Epyc CPU inventory on win32
* fix #447: Support Cgroup 2 resource limits on LXC containers inventory
* fix #447, #464: Support Cgroup 2 resource limits on LXC containers inventory
* Fix local inventory when html format is requested as output format
* fix #430: Enhanced monitor support on MacOS Ventura with M1 CPU
* fix #449: Don't override storage size with null value reported by hdparm on win32
Expand Down
1 change: 1 addition & 0 deletions lib/GLPI/Agent/Task/Inventory/Virtualization/Lxc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ sub _getVirtualMachine {

if ($key eq 'lxc.cgroup.cpuset.cpus' || $key eq 'lxc.cgroup2.cpuset.cpus') {
###eg: lxc.cgroup.cpuset.cpus = 0,3-5,7,2,1
$container->{VCPU} = 0;
foreach my $cpu ( split( /,/, $val ) ){
if ( $cpu =~ /(\d+)-(\d+)/ ){
$container->{VCPU} += $2 - $1 + 1;
Expand Down

0 comments on commit 05e6510

Please sign in to comment.