-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use dmidecode to check available RAM in preflight checks (#730)
The current implementation of the preflight memory check uses `MemTotal` from `/proc/meminfo` to try to figure out how much RAM there is. This number will always be a little bit low, which is confusing ("Why is it reporting only 60GiB when I know I have 64GiB?!?") and means we have to allow a certain amount of wiggle room when determining whether or not the system meets the minimum production requirements. This commit makes the following changes: 1. We use `dmidecode -t 19` to get the exact amount of memory installed in the system. No weird low values, no need for wiggle room. 2. In case the above fails and we have to fall back to `/proc/meminfo`, increase the wiggle room from 5% to 10%. 3. For really low RAM scenarios (e.g. tiny test VMs with <1GiB RAM), report available memory in MiB rather than KiB (nobody thinks in KiB anymore, right?) Related issue: harvester/harvester#5599 Signed-off-by: Tim Serong <[email protected]> (cherry picked from commit c76086f)
- Loading branch information
Showing
3 changed files
with
209 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters