diff --git a/lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm b/lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm index c4dc832e8..77337eadd 100644 --- a/lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm +++ b/lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm @@ -26,8 +26,9 @@ sub isEnabled { sub doInventory { my (%params) = @_; - my $inventory = $params{inventory}; - my $logger = $params{logger}; + my $inventory = $params{inventory}; + my $logger = $params{logger}; + my @physmemsystems = ('Physical', 'VMware'); my $memories = _getMemories(logger => $logger); @@ -36,7 +37,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 && ! grep ( /^$vmsystem$/, @physmemsystems)) { my @components = grep { exists $_->{CAPACITY} } @$memories; if ( @components == 1) { my $real_memory = $inventory->getHardware('MEMORY');