-
Notifications
You must be signed in to change notification settings - Fork 81
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
Use dmidecode to check available RAM in preflight checks #730
Merged
tserong
merged 1 commit into
harvester:master
from
tserong:wip-preflight-memory-dmidecode
May 20, 2024
Merged
Use dmidecode to check available RAM in preflight checks #730
tserong
merged 1 commit into
harvester:master
from
tserong:wip-preflight-memory-dmidecode
May 20, 2024
Conversation
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
Vicente-Cheng
approved these changes
May 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! just a nit.
Thanks for the enhancement!
bk201
approved these changes
May 20, 2024
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]>
tserong
force-pushed
the
wip-preflight-memory-dmidecode
branch
from
May 20, 2024 04:47
39f2b7e
to
6a2d80c
Compare
@Mergifyio backport v1.3 |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
May 20, 2024
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)
bk201
pushed a commit
that referenced
this pull request
May 21, 2024
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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
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.Solution:
This commit makes the following changes:
dmidecode -t 19
to get the exact amount of memory installed in the system. No weird low values, no need for wiggle room./proc/meminfo
, increase the wiggle room from 5% to 10%.Related Issue:
harvester/harvester#5599
Test plan: