From 01c8815bb587d1530885ca9c5d6c474e0a7f0fea Mon Sep 17 00:00:00 2001 From: jennomics Date: Sat, 13 Mar 2021 10:03:56 -0800 Subject: [PATCH] Update ebs-autoscale.json (#24) * change default volume type from gp2 to gp3 * add `-t|--volume-type` option to `install.sh` * bump initial volume size to 200GB Co-authored-by: W. Lee Pang, PhD --- config/ebs-autoscale.json | 2 +- install.sh | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/config/ebs-autoscale.json b/config/ebs-autoscale.json index eed111f..f20ef99 100644 --- a/config/ebs-autoscale.json +++ b/config/ebs-autoscale.json @@ -6,7 +6,7 @@ "logical_volume": "autoscale_lv" }, "volume": { - "type": "gp2", + "type": "%%VOLUMETYPE%%", "iops": 3000, "encrypted": 1 }, diff --git a/install.sh b/install.sh index 2a5d31e..0674c33 100644 --- a/install.sh +++ b/install.sh @@ -52,20 +52,25 @@ Options -m, --mountpoint MOUNTPOINT Mount point for autoscale volume (default: /scratch) + + -t, --volume-type VOLUMETYPE + Volume type (default: gp3) -s, --initial-size SIZE - Initial size of the volume in GB. (Default: 100) + Initial size of the volume in GB. (Default: 200) Only used if --initial-device is NOT specified. EOF ) MOUNTPOINT=/scratch -SIZE=100 +SIZE=200 +VOLUMETYPE=gp3 DEVICE="" FILE_SYSTEM=btrfs BASEDIR=$(dirname $0) + . ${BASEDIR}/shared/utils.sh initialize @@ -78,6 +83,10 @@ while (( "$#" )); do SIZE=$2 shift 2 ;; + -t|--volume-type) + VOLUMETYPE=$2 + shift 2 + ;; -d|--initial-device) DEVICE=$2 shift 2 @@ -140,6 +149,7 @@ cp ${BASEDIR}/config/ebs-autoscale.logrotate /etc/logrotate.d/ebs-autoscale # install default config cat ${BASEDIR}/config/ebs-autoscale.json | \ sed -e "s#%%MOUNTPOINT%%#${MOUNTPOINT}#" | \ + sed -e "s#%%VOLUMETYPE%%#${VOLUMETYPE}#" | \ sed -e "s#%%FILESYSTEM%%#${FILE_SYSTEM}#" \ > /etc/ebs-autoscale.json @@ -153,7 +163,7 @@ fi # If a device is not given, or if the device is not valid if [ -z "${DEVICE}" ] || [ ! -b "${DEVICE}" ]; then - DEVICE=$(create-ebs-volume --size $SIZE) + DEVICE=$(create-ebs-volume --size $SIZE --type $VOLUMETYPE) fi # create and mount the BTRFS filesystem