Linux/Archs/i386/CPU.pm reports incorrect CPU information

Bug #1420073 reported by Eric Germán Burgueño
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OCS Inventory: Unified Unix Agent
Fix Released
Low
Frank

Bug Description

Hello,

The current code for the CPU.pm module uses `dmidecode -t processor` to report CPU information, however this is not reliable in many cases, and is reporting incorrect information for the VMs in my environment:

# cat /proc/cpuinfo| grep processor
processor : 0
processor : 1
processor : 2
processor : 3
# dmidecode -t processor|grep socket|wc -l
64
# dmesg|grep Hypervisor
Hypervisor detected: VMware

This VM in particular has been migrated from an old ESX cluster, where the Physical host had 64 CPU cores. The new cluster uses hosts with 80 CPU cores but the SMBIOS information from the VM hasn't changed.
The man page for dmidecode does warn:
BUGS
       More often than not, information contained in the DMI tables is inaccurate, incomplete or simply wrong.

Of course the other obvious discrepancy is that the VM has only 4 CPUs assigned, but the physical host has 80, so even on new VMs created on the new cluster the outputs of /proc/cpuinfo differ completely from that of dmidecode. A visible effect of this, is that the number of processors reported back in the inventory is always 1 more than the real count:

# ocsinventory-agent --force --debug 2>&1|grep '<CPUS>'
    <CPUS>
    <CPUS>
    <CPUS>
# cat /proc/cpuinfo| grep processor
processor : 0
processor : 1
# dmidecode -t processor|grep socket|wc -l
128

# ocsinventory-agent --version
Ocsinventory unified agent for UNIX, Linux and MacOSX (2.1.1)

The good news is that on physical hosts, the dmidecode information is generally OK. Maybe the CPU.pm could check if the host is a VM and not use dmidecode at all if that's the case?

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Frank (frank-bourdeau)
Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: In Progress → Fix Committed
Revision history for this message
Michael (amwon-ca) wrote :

Where can I download this fix? Thanks.

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: Fix Committed → Fix Released
milestone: none → 2.2rc1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.