From 103cccd786ce0a3ec6e5df421b11739469a97db4 Mon Sep 17 00:00:00 2001 From: Stefan Dinescu Date: Fri, 7 Sep 2018 15:56:12 +0300 Subject: [PATCH] Simplify disk space allocation Allocating of space on the root disk was done in kickstart, combined with config_controller. Various checks for disk and volume group space made it difficult to add new filesystem partitions. To simplify this, all checks are now merged under disk size checks. Kickstart files now create the partitions of the same size for rootfs and log partitions, no matter the disk size, with the only variable size being the cgts-vg size. Thus, any future changes will only need to consider only this size for ensuring enough space is present. The limit between small and big disks is 240GB, with a minimum disk size of 120GB. Depends-On: https://review.openstack.org/#/c/600743/ Change-Id: I37ecc8eb5468811d1ca3a71f8e2a0629525e8fad Closes-bug: 1791170 Signed-off-by: Stefan Dinescu --- bsp-files/kickstarts/pre_disk_aio.cfg | 42 +++++++++++--------- bsp-files/kickstarts/pre_disk_controller.cfg | 13 ++---- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/bsp-files/kickstarts/pre_disk_aio.cfg b/bsp-files/kickstarts/pre_disk_aio.cfg index 407243b1..1d0995a5 100755 --- a/bsp-files/kickstarts/pre_disk_aio.cfg +++ b/bsp-files/kickstarts/pre_disk_aio.cfg @@ -10,7 +10,7 @@ ## ## BACKUP_OVERHEAD = 20 ## -## Physical install +## Physical install (for disks over 240GB) ## - DB size is doubled to allow for upgrades ## ## DEFAULT_IMAGE_STOR_SIZE = 10 @@ -30,16 +30,16 @@ ## CGCS_PV_SIZE = 10240 + 2*20480 + 20480 + 51200 + 8196 + ## 8196 + 2048 + 2048 + 1024 + 1024 + 5120 + 16 = 150544 ## -## small install - uses is_virtual check +## small install - (for disks below 240GB) ## - DB size is doubled to allow for upgrades ## -## DEFAULT_VIRTUAL_IMAGE_STOR_SIZE = 8 -## DEFAULT_VIRTUAL_DATABASE_STOR_SIZE = 5 -## DEFAULT_VIRTUAL_IMG_CONVERSION_STOR_SIZE = 8 -## DEFAULT_VIRTUAL_BACKUP_STOR_SIZE = 5 +## DEFAULT_SMALL_IMAGE_STOR_SIZE = 10 +## DEFAULT_SMALL_DATABASE_STOR_SIZE = 10 +## DEFAULT_SMALL_IMG_CONVERSION_STOR_SIZE = 10 +## DEFAULT_SMALL_BACKUP_STOR_SIZE = 30 ## -## LOG_VOL_SIZE = 4096 -## SCRATCH_VOL_SIZE = 4096 +## LOG_VOL_SIZE = 8192 +## SCRATCH_VOL_SIZE = 8192 ## RABBIT = 2048 ## PLATFORM = 2048 ## ANCHOR = 1024 @@ -47,8 +47,8 @@ ## GNOCCHI = 5120 ## RESERVED_PE = 16 (based on pesize=32768) ## -## CGCS_PV_SIZE = 8192 + 2*5120 + 8192 + 5120 + 4096 + -## 4096 + 2048 + 2048 + 1024 + 1024 + 5120 +16 = 51216 +## CGCS_PV_SIZE = 10240 + 2*10240 + 10240 + 30720 + 8192 + +## 8192 + 2048 + 2048 + 1024 + 1024 + 5120 +16 = 99344 ## ## NOTE: To maintain upgrade compatability within the volume group, keep the ## undersized LOG_VOL_SIZE and SCRATCH_VOL_SIZE, but size the minimally size @@ -70,20 +70,24 @@ ## - R5 (case #2): /boot (0.5G), / (20G), ## cgts-vg PV (142G), cgts-vg PV (336G) ## + sz=$(blockdev --getsize64 $(get_disk $rootfs_device)) -if [ $sz -le $((161*$gb)) ] ; then - ## This covers vbox or any 55g < disk < 162gb: < 55g won't install - LOG_VOL_SIZE=4000 - SCRATCH_VOL_SIZE=4000 - ROOTFS_SIZE=10000 - CGCS_PV_SIZE=51216 +if [ $sz -le $((240*$gb)) ] ; then + # Round CGCS_PV_SIZE to the closest upper valued + # that can be divided by 1024. 99344/1024= 97.01 so + # CGCS_PV_SIZE=98*1024=100352 + # Using a disk with a size under 120GB as install + # disk will allow the system to install, but + # config_controller will fail + CGCS_PV_SIZE=100352 else - LOG_VOL_SIZE=8000 - SCRATCH_VOL_SIZE=8000 - ROOTFS_SIZE=20000 CGCS_PV_SIZE=150544 fi +ROOTFS_SIZE=20000 +LOG_VOL_SIZE=8000 +SCRATCH_VOL_SIZE=8000 + ROOTFS_OPTIONS="defaults" profile_mode=`cat /proc/cmdline |xargs -n1 echo |grep security_profile= | grep extended` if [ -n "$profile_mode" ]; then diff --git a/bsp-files/kickstarts/pre_disk_controller.cfg b/bsp-files/kickstarts/pre_disk_controller.cfg index e4217e75..5ac5af70 100755 --- a/bsp-files/kickstarts/pre_disk_controller.cfg +++ b/bsp-files/kickstarts/pre_disk_controller.cfg @@ -2,16 +2,9 @@ ## NOTE: updates to partition sizes need to be also reflected in ## _controller_filesystem_limits() in sysinv/api/controllers/v1/istorconfig.py -sz=$(blockdev --getsize64 $(get_disk $rootfs_device)) -if [ $sz -le $((60*$gb)) ] ; then - LOG_VOL_SIZE=4000 - SCRATCH_VOL_SIZE=4000 - ROOTFS_SIZE=10000 -else - LOG_VOL_SIZE=8000 - SCRATCH_VOL_SIZE=8000 - ROOTFS_SIZE=20000 -fi +ROOTFS_SIZE=20000 +LOG_VOL_SIZE=8000 +SCRATCH_VOL_SIZE=8000 ROOTFS_OPTIONS="defaults" profile_mode=`cat /proc/cmdline |xargs -n1 echo |grep security_profile= | grep extended`