Linux/Archs/i386/CPU.pm reports incorrect CPU information
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?
Changed in ocsinventory-unix-agent: | |
status: | New → In Progress |
importance: | Undecided → Low |
assignee: | nobody → Frank (frank-bourdeau) |
Changed in ocsinventory-unix-agent: | |
status: | In Progress → Fix Committed |
Changed in ocsinventory-unix-agent: | |
status: | Fix Committed → Fix Released |
milestone: | none → 2.2rc1 |
Where can I download this fix? Thanks.