Merge "launch-node : cap to 8gb swap"

This commit is contained in:
Zuul 2021-03-30 23:57:15 +00:00 committed by Gerrit Code Review
commit ff6d7cc8b2

View File

@ -25,7 +25,7 @@ if [ `grep SwapTotal /proc/meminfo | awk '{ print $2; }'` -eq 0 ]; then
MEMKB=`grep MemTotal /proc/meminfo | awk '{print $2; }'`
# Use the nearest power of two in MB as the swap size.
# This ensures that the partitions below are aligned properly.
MEM=`python3 -c "import math ; print(2**int(round(math.log($MEMKB/1024, 2))))"`
MEM=`python3 -c "import math ; print(min(2**int(round(math.log($MEMKB/1024, 2))),8))"`
# Avoid using config drive device for swap
if [ -n "$DEV" ] && ! blkid | grep $DEV | grep TYPE ; then