windows ansible_memtotal_mb reports 1mb less #49608
Labels
affects_2.8
This issue/PR affects Ansible v2.8
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
module
This issue/PR relates to a module.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
windows
Windows community
SUMMARY
The Powershell command behind the ansible_memtotal_mb uses a math round of the TotalPhysicalMemory, but it's always rounding the value down.
Because of this, a server with 2GB for example reports 2047MB memotal_mb.
I'll create a PR to replace the math
round
withceiling
, so the reported MB matches the actual installed RAM in GB.ISSUE TYPE
COMPONENT NAME
./lib/ansible/modules/windows/setup.ps1
ANSIBLE VERSION
OS / ENVIRONMENT
Tested on Windows Server 2012R2 and Windows Server 2016
STEPS TO REPRODUCE
EXPECTED RESULTS
For a server with 1GB RAM, 1024 MB
For a server with 2GB RAM, 2048 MB
...
ACTUAL RESULTS
1GB -> 1023MB
2GB -> 2047MB
...
The text was updated successfully, but these errors were encountered: