Use zone[0] for any left over nodes

This commit is contained in:
Michael Vines 2019-05-11 13:48:16 -07:00
parent eb4515525d
commit bfc65e829e
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 3 additions and 2 deletions

View File

@ -633,9 +633,10 @@ EOF
num_zones=${#zones[@]}
numNodesPerZone=$((additionalFullNodeCount / num_zones))
numLeftOverNodes=$((additionalFullNodeCount % num_zones))
for ((i=0; i < "$num_zones"; i++)); do
for ((i=((num_zones - 1)); i >= 0; i--)); do
zone=${zones[i]}
if [[ $i -eq $((num_zones - 1)) ]]; then
if [[ $i -eq 0 ]]; then
numNodesPerZone=$((numNodesPerZone + numLeftOverNodes))
fi
cloud_CreateInstances "$prefix" "$prefix-$zone-fullnode" "$numNodesPerZone" \