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

facts: fix SPARC cpu count on linux #30261

Merged
merged 1 commit into from
Sep 22, 2017
Merged

facts: fix SPARC cpu count on linux #30261

merged 1 commit into from
Sep 22, 2017

Conversation

mator
Copy link
Contributor

@mator mator commented Sep 13, 2017

On sparc64, /proc/cpuinfo has no usual 'model name', 'Processor', 'vendor_id', 'Vendor',
as a result "ansible_processor_vcpus" is always 1.
Add check element "ncpus active" to fix the issue.

Without a patch:

$ ansible localhost -m setup -a 'filter=ansible_processor*'
[WARNING]: provided hosts list is empty, only localhost is available

localhost | SUCCESS => {
"ansible_facts": {
"ansible_processor": [
"UltraSparc T5 (Niagara5)"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 1,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 1
},
"changed": false
}

with the patch:

$ ansible localhost -m setup -a 'filter=ansible_processor*'
[WARNING]: provided hosts list is empty, only localhost is available

localhost | SUCCESS => {
"ansible_facts": {
"ansible_processor": [
"UltraSparc T5 (Niagara5)"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 8,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 8
},
"changed": false
}
$ cat /proc/cpuinfo
cpu : UltraSparc T5 (Niagara5)
fpu : UltraSparc T5 integrated FPU
pmu : niagara5
prom : OBP 4.38.8 2017/02/22 13:51
type : sun4v
ncpus probed : 8
ncpus active : 8
D$ parity tl1 : 0
I$ parity tl1 : 0
cpucaps : flush,stbar,swap,muldiv,v9,blkinit,n2,mul32,div32,v8plus,popc,vis,vis2,ASIBlkInit,fmaf,vis3,hpc,ima,pause,cbcond,aes,des,kasumi,camellia,md5,sha1,sha256,sha512,mpmul,montmul,montsqr,crc32c
Cpu0ClkTck : 00000000d6924470
Cpu1ClkTck : 00000000d6924470
Cpu2ClkTck : 00000000d6924470
Cpu3ClkTck : 00000000d6924470
Cpu4ClkTck : 00000000d6924470
Cpu5ClkTck : 00000000d6924470
Cpu6ClkTck : 00000000d6924470
Cpu7ClkTck : 00000000d6924470
MMU Type : Hypervisor (sun4v)
MMU PGSZs : 8K,64K,4MB,256MB,2GB
State:
CPU0: online
CPU1: online
CPU2: online
CPU3: online
CPU4: online
CPU5: online
CPU6: online
CPU7: online
SUMMARY
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ANSIBLE VERSION
ansible 2.3.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.14rc1 (default, Sep  5 2017, 18:16:23) [GCC 7.2.0]
ADDITIONAL INFORMATION

On sparc64, /proc/cpuinfo has no usual 'model name', 'Processor', 'vendor_id', 'Vendor',
as a result "ansible_processor_vcpus" is always 1.
Add check element "ncpus active" to fix the issue.

Without a patch:

$ ansible localhost -m setup -a 'filter=ansible_processor*'
[WARNING]: provided hosts list is empty, only localhost is available

localhost | SUCCESS => {
"ansible_facts": {
"ansible_processor": [
"UltraSparc T5 (Niagara5)"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 1,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 1
},
"changed": false
}

with the patch:

$ ansible localhost -m setup -a 'filter=ansible_processor*'
[WARNING]: provided hosts list is empty, only localhost is available

localhost | SUCCESS => {
"ansible_facts": {
"ansible_processor": [
"UltraSparc T5 (Niagara5)"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 8,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 8
},
"changed": false
}

$ cat /proc/cpuinfo
cpu : UltraSparc T5 (Niagara5)
fpu : UltraSparc T5 integrated FPU
pmu : niagara5
prom : OBP 4.38.8 2017/02/22 13:51
type : sun4v
ncpus probed : 8
ncpus active : 8
D$ parity tl1 : 0
I$ parity tl1 : 0
cpucaps : flush,stbar,swap,muldiv,v9,blkinit,n2,mul32,div32,v8plus,popc,vis,vis2,ASIBlkInit,fmaf,vis3,hpc,ima,pause,cbcond,aes,des,kasumi,camellia,md5,sha1,sha256,sha512,mpmul,montmul,montsqr,crc32c
Cpu0ClkTck : 00000000d6924470
Cpu1ClkTck : 00000000d6924470
Cpu2ClkTck : 00000000d6924470
Cpu3ClkTck : 00000000d6924470
Cpu4ClkTck : 00000000d6924470
Cpu5ClkTck : 00000000d6924470
Cpu6ClkTck : 00000000d6924470
Cpu7ClkTck : 00000000d6924470
MMU Type : Hypervisor (sun4v)
MMU PGSZs : 8K,64K,4MB,256MB,2GB
State:
CPU0: online
CPU1: online
CPU2: online
CPU3: online
CPU4: online
CPU5: online
CPU6: online
CPU7: online
@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bugfix_pull_request module_utils/facts needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 13, 2017
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Sep 14, 2017
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 22, 2017
@alikins
Copy link
Contributor

alikins commented Sep 22, 2017

LGTM, shipit

Thanks for the patch and the sample data!

@alikins alikins merged commit e93ecac into ansible:devel Sep 22, 2017
zorun pushed a commit to zorun/ansible that referenced this pull request Sep 23, 2017
On sparc64, /proc/cpuinfo has no usual 'model name', 'Processor', 'vendor_id', 'Vendor',
as a result "ansible_processor_vcpus" is always 1.
Add check element "ncpus active" to fix the issue.

(cherry picked from commit e93ecac)
zorun pushed a commit to zorun/ansible that referenced this pull request Sep 23, 2017
On sparc64, /proc/cpuinfo has no usual 'model name', 'Processor', 'vendor_id', 'Vendor',
as a result "ansible_processor_vcpus" is always 1.
Add check element "ncpus active" to fix the issue.

Backport from e93ecac (ansible#30261)
zorun pushed a commit to zorun/ansible that referenced this pull request Sep 23, 2017
On sparc64, /proc/cpuinfo has no usual 'model name', 'Processor', 'vendor_id', 'Vendor',
as a result "ansible_processor_vcpus" is always 1.
Add check element "ncpus active" to fix the issue.

Backport from e93ecac (ansible#30261)
prasadkatti pushed a commit to prasadkatti/ansible that referenced this pull request Oct 1, 2017
On sparc64, /proc/cpuinfo has no usual 'model name', 'Processor', 'vendor_id', 'Vendor',
as a result "ansible_processor_vcpus" is always 1.
Add check element "ncpus active" to fix the issue.
BondAnthony pushed a commit to BondAnthony/ansible that referenced this pull request Oct 5, 2017
On sparc64, /proc/cpuinfo has no usual 'model name', 'Processor', 'vendor_id', 'Vendor',
as a result "ansible_processor_vcpus" is always 1.
Add check element "ncpus active" to fix the issue.
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. c:module_utils/facts module_utils/facts stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants