Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

test: check vmssCSE resource w/ VMSS health check #4663

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/e2e/kubernetes/scripts/vmss-health-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ while true; do
((NUM_DELETED_INSTANCES++))
fi
done
for TARGET_VMSS_INSTANCE in $(az vmss list-instances -g $RESOURCE_GROUP -n $TERMINAL_VMSS | jq -r '.[].resources[] | select(.name == "vmssCSE" and .provisioningState == "Failed") | .id' | awk -F'/' '{print $9}'); do
echo $(date) Deleting VMSS $TERMINAL_VMSS instance $TARGET_VMSS_INSTANCE
if ! az vmss delete-instances -n $TERMINAL_VMSS -g $RESOURCE_GROUP --instance-id ${TARGET_VMSS_INSTANCE##*_}; then
sleep 30
else
sleep 1
((NUM_DELETED_INSTANCES++))
fi
done
if [ "$HAS_FAILED_STATE_INSTANCE" == "true" ]; then
echo $(date) Waiting for $TERMINAL_VMSS to reach a terminal ProvisioningState after failed instances were deleted...
sleep 30
Expand Down