Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Update ebs-autoscale.json (#24)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
jennomics and wleepang authored Mar 13, 2021
1 parent 68c0d14 commit 01c8815
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/ebs-autoscale.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"logical_volume": "autoscale_lv"
},
"volume": {
"type": "gp2",
"type": "%%VOLUMETYPE%%",
"iops": 3000,
"encrypted": 1
},
Expand Down
16 changes: 13 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -78,6 +83,10 @@ while (( "$#" )); do
SIZE=$2
shift 2
;;
-t|--volume-type)
VOLUMETYPE=$2
shift 2
;;
-d|--initial-device)
DEVICE=$2
shift 2
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 01c8815

Please sign in to comment.