Check correct minimum size for data disk
Currently we choose the largest available disk as the data disk, however this may be too small to be useful. This patch checks disqualifies disks that are smaller than the minimum. It also sets the minimum to the proper value of 60GB free on the root disk or 60GB available on the designated secondary disk. The previous check was 60GB on root and 80GB on the secondary disk which is not the intented check as noted in the documentation. Change-Id: Id225dc55068e1eed2e19e1e27b0f626163f03db2
This commit is contained in:
parent
4ebf7974ef
commit
ec14005f76
@ -33,9 +33,11 @@ info_block "Checking for required libraries." 2> /dev/null || source $(dirname $
|
|||||||
# Log some data about the instance and the rest of the system
|
# Log some data about the instance and the rest of the system
|
||||||
log_instance_info
|
log_instance_info
|
||||||
|
|
||||||
# Determine the largest secondary disk device available for repartitioning
|
# Get minimum disk size
|
||||||
DATA_DISK_DEVICE=$(lsblk -brndo NAME,TYPE,RO,SIZE | \
|
DATA_DISK_MIN_SIZE="$((1024**3 * $(awk '/bootstrap_host_data_disk_min_size/{print $2}' $(dirname ${0})/../tests/roles/bootstrap-host/defaults/main.yml) ))"
|
||||||
awk '/d[b-z]+ disk 0/{ if ($4>m){m=$4; d=$1}}; END{print d}')
|
|
||||||
|
# Determine the largest secondary disk device that meets the minimum size
|
||||||
|
DATA_DISK_DEVICE=$(lsblk -brndo NAME,TYPE,RO,SIZE | awk '/d[b-z]+ disk 0/{ if ($4>m && $4>='$DATA_DISK_MIN_SIZE'){m=$4; d=$1}}; END{print d}')
|
||||||
|
|
||||||
# Only set the secondary disk device option if there is one
|
# Only set the secondary disk device option if there is one
|
||||||
if [ -n "${DATA_DISK_DEVICE}" ]; then
|
if [ -n "${DATA_DISK_DEVICE}" ]; then
|
||||||
|
@ -80,7 +80,7 @@ bootstrap_host_data_disk_device_force: no
|
|||||||
#
|
#
|
||||||
# If the storage capacity on this device is greater than or equal to this
|
# If the storage capacity on this device is greater than or equal to this
|
||||||
# size (in GB), the bootstrap process will use it.
|
# size (in GB), the bootstrap process will use it.
|
||||||
bootstrap_host_data_disk_min_size: 80
|
bootstrap_host_data_disk_min_size: 60
|
||||||
|
|
||||||
### MongoDB Settings
|
### MongoDB Settings
|
||||||
# MongoDB is installed on the host in the AIO for Ceilometer and Aodh to use.
|
# MongoDB is installed on the host in the AIO for Ceilometer and Aodh to use.
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
- name: Fail if there is not enough space available in /
|
- name: Fail if there is not enough space available in /
|
||||||
assert:
|
assert:
|
||||||
that: |
|
that: |
|
||||||
(host_root_space_available_bytes | int) >= ((host_data_disk_min_size_bytes | int) * 0.75)
|
(host_root_space_available_bytes | int) >= (host_data_disk_min_size_bytes | int)
|
||||||
when:
|
when:
|
||||||
- bootstrap_host_data_disk_device is not defined
|
- bootstrap_host_data_disk_device is not defined
|
||||||
tags:
|
tags:
|
||||||
|
Loading…
Reference in New Issue
Block a user