Add option to pass boot disk type to gce create (#1308)
This commit is contained in:
parent
a51c2f193e
commit
3199f174a3
13
net/gce.sh
13
net/gce.sh
|
@ -5,6 +5,7 @@ here=$(dirname "$0")
|
||||||
source "$here"/common.sh
|
source "$here"/common.sh
|
||||||
|
|
||||||
cloudProvider=$(basename "$0" .sh)
|
cloudProvider=$(basename "$0" .sh)
|
||||||
|
bootDiskType=""
|
||||||
case $cloudProvider in
|
case $cloudProvider in
|
||||||
gce)
|
gce)
|
||||||
# shellcheck source=net/scripts/gce-provider.sh
|
# shellcheck source=net/scripts/gce-provider.sh
|
||||||
|
@ -75,6 +76,7 @@ Manage testnet instances
|
||||||
IP Address.
|
IP Address.
|
||||||
For EC2, [address] is the "allocation ID" of the desired
|
For EC2, [address] is the "allocation ID" of the desired
|
||||||
Elastic IP.
|
Elastic IP.
|
||||||
|
-d [disk-type] - Specify a boot disk type (default None) Use pd-ssd to get ssd on GCE.
|
||||||
|
|
||||||
config-specific options:
|
config-specific options:
|
||||||
none
|
none
|
||||||
|
@ -92,7 +94,7 @@ command=$1
|
||||||
shift
|
shift
|
||||||
[[ $command = create || $command = config || $command = delete ]] || usage "Invalid command: $command"
|
[[ $command = create || $command = config || $command = delete ]] || usage "Invalid command: $command"
|
||||||
|
|
||||||
while getopts "h?p:Pn:c:z:ga:" opt; do
|
while getopts "h?p:Pn:c:z:ga:d:" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
h | \?)
|
h | \?)
|
||||||
usage
|
usage
|
||||||
|
@ -120,6 +122,9 @@ while getopts "h?p:Pn:c:z:ga:" opt; do
|
||||||
a)
|
a)
|
||||||
leaderAddress=$OPTARG
|
leaderAddress=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
d)
|
||||||
|
bootDiskType=$OPTARG
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage "Error: unhandled option: $opt"
|
usage "Error: unhandled option: $opt"
|
||||||
;;
|
;;
|
||||||
|
@ -378,16 +383,16 @@ EOF
|
||||||
|
|
||||||
cloud_CreateInstances "$prefix" "$prefix-leader" 1 \
|
cloud_CreateInstances "$prefix" "$prefix-leader" 1 \
|
||||||
"$imageName" "$leaderMachineType" "$leaderBootDiskSizeInGb" \
|
"$imageName" "$leaderMachineType" "$leaderBootDiskSizeInGb" \
|
||||||
"$startupScript" "$leaderAddress"
|
"$startupScript" "$leaderAddress" "$bootDiskType"
|
||||||
|
|
||||||
cloud_CreateInstances "$prefix" "$prefix-validator" "$validatorNodeCount" \
|
cloud_CreateInstances "$prefix" "$prefix-validator" "$validatorNodeCount" \
|
||||||
"$imageName" "$validatorMachineType" "$validatorBootDiskSizeInGb" \
|
"$imageName" "$validatorMachineType" "$validatorBootDiskSizeInGb" \
|
||||||
"$startupScript" ""
|
"$startupScript" "" "$bootDiskType"
|
||||||
|
|
||||||
if [[ $clientNodeCount -gt 0 ]]; then
|
if [[ $clientNodeCount -gt 0 ]]; then
|
||||||
cloud_CreateInstances "$prefix" "$prefix-client" "$clientNodeCount" \
|
cloud_CreateInstances "$prefix" "$prefix-client" "$clientNodeCount" \
|
||||||
"$imageName" "$clientMachineType" "$clientBootDiskSizeInGb" \
|
"$imageName" "$clientMachineType" "$clientBootDiskSizeInGb" \
|
||||||
"$startupScript" ""
|
"$startupScript" "" "$bootDiskType"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$metricsWriteDatapoint "testnet-deploy net-create-complete=1"
|
$metricsWriteDatapoint "testnet-deploy net-create-complete=1"
|
||||||
|
|
|
@ -113,6 +113,7 @@ cloud_CreateInstances() {
|
||||||
declare optionalBootDiskSize="$6"
|
declare optionalBootDiskSize="$6"
|
||||||
declare optionalStartupScript="$7"
|
declare optionalStartupScript="$7"
|
||||||
declare optionalAddress="$8"
|
declare optionalAddress="$8"
|
||||||
|
declare optionalBootDiskType="$9"
|
||||||
|
|
||||||
declare nodes
|
declare nodes
|
||||||
if [[ $numNodes = 1 ]]; then
|
if [[ $numNodes = 1 ]]; then
|
||||||
|
@ -143,6 +144,11 @@ cloud_CreateInstances() {
|
||||||
--metadata-from-file "startup-script=$optionalStartupScript"
|
--metadata-from-file "startup-script=$optionalStartupScript"
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
if [[ -n $optionalBootDiskType ]]; then
|
||||||
|
args+=(
|
||||||
|
--boot-disk-type "${optionalBootDiskType}"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n $optionalAddress ]]; then
|
if [[ -n $optionalAddress ]]; then
|
||||||
[[ $numNodes = 1 ]] || {
|
[[ $numNodes = 1 ]] || {
|
||||||
|
|
Loading…
Reference in New Issue