Skip to content

Commit

Permalink
Bugfix: Memory size value for Vmware Virtual Machine (#572)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ChristopheLacaze authored Jan 8, 2024
1 parent a9666de commit 3281430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/GLPI/Agent/Task/Inventory/Generic/Dmidecode/Memory.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 3281430

Please sign in to comment.