From 328143033f1edd2e71f76a06a19cedaaa88a264b Mon Sep 17 00:00:00 2001 From: Tof <32029396+ChristopheLacaze@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:15:04 +0100 Subject: [PATCH] Bugfix: Memory size value for Vmware Virtual Machine (#572) Dmidecode slot memory size value overrided by /proc/meminfo value when there is only one memory slot for a Vmware virtual machine. It should not. Check Vm system type with regex pattern --- lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm b/lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm index c4dc832e8..413306276 100644 --- a/lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm +++ b/lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm @@ -36,7 +36,7 @@ sub doInventory { # If only one component is defined and we are under a vmsystem, we can update # component capacity to real found size. This permits to support memory size updates. my $vmsystem = $inventory->getHardware('VMSYSTEM'); - if ($vmsystem && $vmsystem ne 'Physical') { + if ($vmsystem && $vmsystem !~ /^(Physical|VMware)$/) { my @components = grep { exists $_->{CAPACITY} } @$memories; if ( @components == 1) { my $real_memory = $inventory->getHardware('MEMORY');