Remove wait loops in non-GPU instance creation and add SSD option as default disk type (#3992)

This commit is contained in:
Dan Albert 2019-04-25 13:43:42 -06:00 committed by GitHub
parent 0add5c1dc8
commit d12705f9b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 10 deletions

View File

@ -192,7 +192,13 @@ cloud_CreateInstances() {
fi fi
if [[ -n $optionalBootDiskType ]]; then if [[ -n $optionalBootDiskType ]]; then
echo Boot disk type not configurable args+=(
--storage-sku "$optionalBootDiskType"
)
else
args+=(
--storage-sku StandardSSD_LRS
)
fi fi
if [[ -n $optionalAddress ]]; then if [[ -n $optionalAddress ]]; then
@ -222,13 +228,12 @@ cloud_CreateInstances() {
az vm create --name "$nodeName" "${args[@]}" --no-wait az vm create --name "$nodeName" "${args[@]}" --no-wait
done done
# 3: Wait until all nodes are created # 3. If GPU is to be enabled, wait until nodes are created, then install the appropriate extension
for nodeName in "${nodes[@]}"; do
az vm wait --created --name "$nodeName" --resource-group "$networkName"
done
# 4. If GPU is to be enabled, install the appropriate extension
if $enableGpu; then if $enableGpu; then
for nodeName in "${nodes[@]}"; do
az vm wait --created --name "$nodeName" --resource-group "$networkName" --verbose --timeout 600
done
for nodeName in "${nodes[@]}"; do for nodeName in "${nodes[@]}"; do
az vm extension set \ az vm extension set \
--resource-group "$networkName" \ --resource-group "$networkName" \
@ -239,9 +244,9 @@ cloud_CreateInstances() {
--no-wait --no-wait
done done
# 5. Wait until all nodes have GPU extension installed # 4. Wait until all nodes have GPU extension installed
for nodeName in "${nodes[@]}"; do for nodeName in "${nodes[@]}"; do
az vm wait --updated --name "$nodeName" --resource-group "$networkName" az vm wait --updated --name "$nodeName" --resource-group "$networkName" --verbose --timeout 600
done done
fi fi
) )
@ -270,7 +275,7 @@ cloud_DeleteInstances() {
done done
# Delete all instances in the id_list and return once they are all deleted # Delete all instances in the id_list and return once they are all deleted
az vm delete --ids "${id_list[@]}" --yes --verbose az vm delete --ids "${id_list[@]}" --yes --verbose --no-wait
) )
} }