Merge "Fix memory detection in ironic-discoverd-ramdisk"
This commit is contained in:
commit
409f8ff131
@ -43,9 +43,11 @@ update ".ipmi_address = \"$BMC_ADDRESS\""
|
|||||||
CPU_ARCH=$(lscpu | grep Architecture | awk '{ print $2 }')
|
CPU_ARCH=$(lscpu | grep Architecture | awk '{ print $2 }')
|
||||||
update ".cpu_arch = \"$CPU_ARCH\""
|
update ".cpu_arch = \"$CPU_ARCH\""
|
||||||
|
|
||||||
# NOTE(lucasagomes): dmidecode because we want to know the total
|
RAM=0
|
||||||
# memory in the system, even the reserved part to the BIOS
|
for i in $(dmidecode --type memory | grep Size | awk '{ print $2; }' | grep -E '[0-9]+');
|
||||||
RAM=$(dmidecode -t 16 | grep 'Maximum Capacity' | awk '{if ($4 == "GB") s+=$3*1024; else s+=$3;} END {print s}')
|
do
|
||||||
|
RAM=$(( RAM + $i ));
|
||||||
|
done
|
||||||
update ".memory_mb = $RAM"
|
update ".memory_mb = $RAM"
|
||||||
|
|
||||||
CPUS=$(cat /proc/cpuinfo | grep processor | wc -l)
|
CPUS=$(cat /proc/cpuinfo | grep processor | wc -l)
|
||||||
|
Loading…
Reference in New Issue
Block a user