Ramdisk should consider the size unit when inspecting the amount of RAM
Bug #1486689 reported by
Lucas Alvares Gomes
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ironic Inspector |
Invalid
|
High
|
Brad Lodgen | ||
diskimage-builder |
Opinion
|
Medium
|
Joey D. |
Bug Description
The code that inspect the amount of RAM [1] is not considering the size unit and assumes MB which may lead to the wrong size to be registered in Ironic.
<snippet>
RAM=0
for i in $(dmidecode --type memory | grep Size | awk '{ print $2; }' | grep -E '[0-9]+');
do
RAM=$(( RAM + $i ));
done
update ".memory_mb = $RAM"
</snippet>
On IRC it was reported that dmidecode sometimes shows "Size" in GB:
<lodgenbd> lucas-hungry: dmidecode returns this for each DIMM: "Size: 32 GB" so that code just adds up all the 32's and gets to 512
We should fix that.
Also, instead of using dmidecode we could look at use /proc/meminfo instead.
summary: |
- Ramdisk should consider the size unit inspecting the RAM memory + Ramdisk should consider the size unit when inspecting the amount of RAM |
Changed in ironic-inspector: | |
assignee: | nobody → Brad Lodgen (lodgenbd) |
Changed in ironic-inspector: | |
status: | New → Confirmed |
status: | Confirmed → In Progress |
Changed in diskimage-builder: | |
importance: | Undecided → Medium |
To post a comment you must log in.
> Also, instead of using dmidecode we could look at use /proc/meminfo instead.
No, we can't. Otherwise good catch!