Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup - fix processor facts for older SMBIOS versions #457

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

jborean93
Copy link
Collaborator

@jborean93 jborean93 commented Dec 12, 2022

SUMMARY

On hosts with older SMBIOS versions (pre 2.5) the core and thread count fields are not present and the current code was just reading the random bytes after this type structure. This caused the processor count to be returned as random values. Instead have a fallback to the slower CIM/WMI method for older hosts.

The ansible_processor_threads_per_core was also being set to the number of threads per processor/CPU and not per core. This fixes the logic to return the correct value as it has been in the past.

It will also ignore any processor entries that are not populated and are not set as enabled.

Finally this also takes into account the Core Count 2 and Thread Count 2 fields on the SMBIOS processor information if present. This is a new field added by SMBIOS 3.0 to be able to return core counts greater than 256.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

setup

@jborean93
Copy link
Collaborator Author

Fix has been confirmed by user who encountered this issue on a host with an older SMBIOS version.

@jborean93 jborean93 merged commit 4a45d3b into ansible-collections:main Dec 13, 2022
@jborean93 jborean93 deleted the processors branch December 13, 2022 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant