Merge "Enable StarlingX in QEMU/KVM VM with small disk"

This commit is contained in:
Zuul 2020-09-10 14:13:46 +00:00 committed by Gerrit Code Review
commit 13a6248586
1 changed files with 86 additions and 75 deletions

View File

@ -1,7 +1,7 @@
## NOTE: updates to partition sizes need to be also reflected in
## - stx-config/.../sysinv/conductor/manager.py:create_controller_filesystems()
## - stx-config/.../sysinv/common/constants.py
## - config/.../sysinv/conductor/manager.py:create_controller_filesystems()
## - config/.../sysinv/common/constants.py
##
## NOTE: When adding partitions, we currently have a max of 4 primary partitions.
## If more than 4 partitions are required, we can use a max of 3 --asprimary,
@ -9,94 +9,81 @@
##
## NOTE: Max default PV size must align with the default controllerfs sizes
##
## BACKUP_OVERHEAD = 10
##
## Physical install (for disks over 240GB)
##***************************************************************************************************
## Large disk install (for disks over 240GB)
## - DB size is doubled to allow for upgrades
##
## DEFAULT_IMAGE_STOR_SIZE = 10
## DEFAULT_DATABASE_STOR_SIZE = 20
## DEFAULT_IMG_CONVERSION_STOR_SIZE = 20
## BACKUP_OVERHEAD = 5GiB
## DEFAULT_IMAGE_STOR_SIZE = 10GiB
## DEFAULT_DATABASE_STOR_SIZE = 20GiB
## DEFAULT_IMG_CONVERSION_STOR_SIZE = 20GiB
## BACKUP = DEFAULT_DATABASE_STOR_SIZE + DEFAULT_IMAGE_STOR_SIZE
## + BACKUP_OVERHEAD = 40
## LOG_VOL_SIZE = 8192
## SCRATCH_VOL_SIZE = 16384
## RABBIT = 2048
## PLATFORM = 2048
## ANCHOR = 1024
## EXTENSION = 1024
## GNOCCHI = 5120
## DOCKER = 30720
## DOCKER_DIST = 16384
## ETCD = 5120
## CEPH_MON = 20480
## KUBELET_VOL_SIZE = 10240
## RESERVED_PE = 16 (based on pesize=32768)
## + BACKUP_OVERHEAD = 40GiB
## LOG_VOL_SIZE = 8GiB
## SCRATCH_VOL_SIZE = 16GiB
## RABBIT = 2GiB
## PLATFORM = 2GiB
## ANCHOR = 1GiB
## EXTENSION = 1GiB
## GNOCCHI = 5GiB
## DOCKER = 30GiB
## DOCKER_DIST = 16GiB
## ETCD = 5GiB
## CEPH_MON = 20GiB
## KUBELET_VOL_SIZE = 10GiB
## RESERVED_PE = 16MiB (based on pesize=32768)
##
## CGCS_PV_SIZE = 10240 + 2*20480 + 20480 + 40960 + 8192 + 16384 + 2048 +
## 2048 + 1024 + 1024 + 5120 + 30720 + 16384 + 5120 +
## 20480 + 10240 + 16 = 231440
## CGCS_PV_SIZE = (10 + 2*20 + 20 + 40 + 8 + 16 + 2 + 2 + 1 + 1 + 5 + 30 + 16 + 5 + 20 + 10)GiB + 16MiB/1024 = 226.02GiB
##
## small install - (for disks below 240GB)
##***************************************************************************************************
## Small disk install - (for disks below 240GB)
## - DB size is doubled to allow for upgrades
##
## 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
## DEFAULT_SMALL_IMAGE_STOR_SIZE = 10GiB
## DEFAULT_SMALL_DATABASE_STOR_SIZE = 10GiB
## DEFAULT_SMALL_IMG_CONVERSION_STOR_SIZE = 10GiB
## DEFAULT_SMALL_BACKUP_STOR_SIZE = 30GiB
##
## LOG_VOL_SIZE = 8192
## SCRATCH_VOL_SIZE = 16384
## RABBIT = 2048
## PLATFORM = 2048
## ANCHOR = 1024
## EXTENSION = 1024
## GNOCCHI = 5120
## DOCKER = 30720
## DOCKER_DIST = 16384
## ETCD = 5120
## CEPH_MON = 20480
## KUBELET_VOL_SIZE = 10240
## RESERVED_PE = 16 (based on pesize=32768)
## LOG_VOL_SIZE = 8GiB
## SCRATCH_VOL_SIZE = 16GiB
## RABBIT = 2GiB
## PLATFORM = 2GiB
## ANCHOR = 1GiB
## EXTENSION = 1GiB
## GNOCCHI = 5GiB
## DOCKER = 30GiB
## DOCKER_DIST = 16GiB
## ETCD = 5GiB
## CEPH_MON = 20GiB
## KUBELET_VOL_SIZE = 10GiB
## RESERVED_PE = 16MiB (based on pesize=32768)
##
##
## CGCS_PV_SIZE = 10240 + 2*10240 + 10240 + 30720 + 8192 + 16384 + 2048 +
## 2048 + 1024 + 1024 + 5120 + 30720 + 16384 + 5120 +
## 20480 + 10240 + 16 = 190480
## CGCS_PV_SIZE = (10 + 2*10 + 10 + 30 + 8 + 16 + 2 + 2 + 1 + 1 + 5 + 30 + 16 + 5 + 20 + 10)GiB + 16MiB/1024 = 186.02GiB
##
## NOTE: To maintain upgrade compatability within the volume group, keep the
## undersized LOG_VOL_SIZE and SCRATCH_VOL_SIZE, but size the minimally size
## physical volume correctly.
##***************************************************************************************************
## Tiny disk install - (for disks below 154GB)
##
## R4 AIO installations:
## - R4 (case #1): /boot (0.5G), / (20G),
## cgts-vg PV (239G), /local_pv (239G)
## - R4 (case #2): /boot (0.5G), / (20G),
## cgts-vg PV (239G), cgts-vg (239G)
## NOTE: Tiny disk setup is mainly for StarlingX running in QEMU/KVM VM.
##
## Upgrade migration will start with R5 install and create a partition to align
## above so filesystems within the volume group will be able to maintain their
## sizes in R5
## - R5 install : /boot (0.5G), / (20G),
## cgts-vg PV (142G), un-partitioned (336G)
## - R5 (case #1): /boot (0.5G), / (20G),
## cgts-vg PV (142G), cgts-vg PV (97G), unpartitioned (239G)
## - R5 (case #2): /boot (0.5G), / (20G),
## cgts-vg PV (142G), cgts-vg PV (336G)
## DEFAULT_TINY_PLATFORM_STOR_SIZE = 1GiB
## DEFAULT_TINY_DATABASE_STOR_SIZE = 1GiB
## DEFAULT_TINY_BACKUP_STOR_SIZE = 1GiB
##
sz=$(blockdev --getsize64 $rootfs_device)
if [ $sz -le $((240*$gb)) ] ; then
# Round CGCS_PV_SIZE to the closest upper value that can be divided by 1024.
# 190480/1024=186.02. CGCS_PV_SIZE=187*1024=191488. Using a disk with a
# size under 187GiB will fail.
CGCS_PV_SIZE=191488
else
# Round CGCS_PV_SIZE to the closest upper value that can be divided by 1024.
# 231440/1024=226.02. CGCS_PV_SIZE=227*1024=232448.
CGCS_PV_SIZE=232448
fi
## LOG_VOL_SIZE = 3GiB
## SCRATCH_VOL_SIZE = 2GiB
## RABBIT_LV = 2GiB
## DEFAULT_EXTENSION_STOR_SIZE = 1GiB
## TINY_KUBERNETES_DOCKER_STOR_SIZE = 20GiB
## TINY_DOCKER_DISTRIBUTION_STOR_SIZE = 8GiB
## TINY_ETCD_STOR_SIZE = 1GiB
## TINY_KUBELET_STOR_SIZE = 2GiB
##
## CGCS_PV_SIZE = (1 + 2*1 + 1 + 3 + 2 + 2 + 1 + 20 + 8 + 1 + 2)GiB = 43GiB
##
## MINIMUM_TINY_DISK_SIZE = CGCS_PV_SIZE + ROOTFS_SIZE + EFI_SIZE + BOOT_SIZE + PLATFORM_BACKUP_SIZE
## = 43 + 15 + 0.3 + 0.5 + 1 = 60GiB
ROOTFS_SIZE=20000
LOG_VOL_SIZE=8000
@ -105,6 +92,30 @@ PLATFORM_BACKUP_SIZE=10000
BOOT_SIZE=500
EFI_SIZE=300
# The default disk size thresholds must align with the ones in
# config/.../sysinv/common/constants.py
# which are DEFAULT_SMALL_DISK_SIZE
# MINIMUM_SMALL_DISK_SIZE
default_small_disk_size=240
minimum_small_disk_size=154
sz=$(blockdev --getsize64 $rootfs_device)
# Round CGCS_PV_SIZE to the closest upper value that can be divided by 1024.
if [ $sz -gt $(($default_small_disk_size*$gb)) ] ; then
# Large disk: CGCS_PV_SIZE=227GiB*1024=232448
CGCS_PV_SIZE=232448
elif [ $sz -ge $(($minimum_small_disk_size*$gb)) ] ; then
# Small disk: CGCS_PV_SIZE=187GiB*1024=191488
CGCS_PV_SIZE=191488
else
# Tiny disk: CGCS_PV_SIZE=43GiB*1024=44032
# Using a disk with a size under 60GiB will fail.
CGCS_PV_SIZE=44032
ROOTFS_SIZE=15000
LOG_VOL_SIZE=3000
SCRATCH_VOL_SIZE=2000
PLATFORM_BACKUP_SIZE=1000
fi
ROOTFS_OPTIONS="defaults"
profile_mode=`cat /proc/cmdline |xargs -n1 echo |grep security_profile= | grep extended`
if [ -n "$profile_mode" ]; then