Bird
Raised Fist0
Azurecloud~10 mins

VM Scale Sets for auto scaling in Azure - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a VM Scale Set resource in Azure ARM template.

Azure
"type": "Microsoft.Compute/virtualMachineScaleSets",
"apiVersion": "2022-08-01",
"name": "myScaleSet",
"location": "eastus",
"sku": {
  "name": "Standard_DS1_v2",
  "tier": "Standard",
  "capacity": [1]
},
"properties": {}
Drag options to blanks, or click blank then click option'
A3
B10
C0
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Setting capacity to 0 will create no VMs.
Setting capacity too high may increase costs unnecessarily.
2fill in blank
medium

Complete the code to specify the upgrade policy mode for the VM Scale Set.

Azure
"upgradePolicy": {
  "mode": "[1]"
}
Drag options to blanks, or click blank then click option'
AManual
BScheduled
CRolling
DAutomatic
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Rolling' or 'Scheduled' which are not valid modes in this context.
Confusing 'Automatic' with 'Manual' mode.
3fill in blank
hard

Fix the error in the autoscale profile metric trigger condition.

Azure
"metricTrigger": {
  "metricName": "Percentage CPU",
  "metricNamespace": "",
  "timeGrain": "PT1M",
  "statistic": "Average",
  "timeWindow": "PT5M",
  "timeAggregation": "Average",
  "operator": "[1]",
  "threshold": 75
}
Drag options to blanks, or click blank then click option'
AGreaterThan
BGreaterThanOrEqual
CLessThan
DEquals
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'GreaterThan' excludes the threshold value.
Using 'Equals' triggers only when exactly 75%, which is rare.
4fill in blank
hard

Fill both blanks to define a scale out rule that increases capacity by 1 when CPU is high.

Azure
"scaleOut": {
  "cooldown": "PT1M",
  "action": {
    "type": "ChangeCount",
    "value": "[1]",
    "direction": "[2]"
  }
}
Drag options to blanks, or click blank then click option'
A1
BIncrease
CDecrease
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Decrease' direction for scale out.
Setting value to 2 instead of 1 for a single increment.
5fill in blank
hard

Fill all three blanks to define a scale in rule that decreases capacity by 1 when CPU is low.

Azure
"scaleIn": {
  "cooldown": "PT5M",
  "action": {
    "type": "ChangeCount",
    "value": "[1]",
    "direction": "[2]",
    "instanceIds": [[3]]
  }
}
Drag options to blanks, or click blank then click option'
A1
BDecrease
C"1"
D"0"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Increase' direction for scale in.
Leaving instanceIds empty or incorrect.

Practice

(1/5)
1. What is the main purpose of Azure VM Scale Sets in cloud infrastructure?
easy
A. To store data permanently in the cloud
B. To create a single virtual machine with fixed resources
C. To automatically adjust the number of virtual machines based on demand
D. To manage user access and permissions

Solution

  1. Step 1: Understand VM Scale Sets function

    VM Scale Sets allow running multiple VMs that can increase or decrease automatically.
  2. Step 2: Identify the main benefit

    This automatic adjustment helps handle changes in workload efficiently.
  3. Final Answer:

    To automatically adjust the number of virtual machines based on demand -> Option C
  4. Quick Check:

    Auto scaling = Adjust VM count [OK]
Hint: Think 'auto' means adjusting VM count automatically [OK]
Common Mistakes:
  • Confusing VM Scale Sets with storage services
  • Thinking it manages user permissions
  • Assuming it creates only one VM
2. Which of the following is the correct way to define an autoscale rule in Azure VM Scale Sets to add instances when CPU usage is above 70%?
easy
A. Set a rule to add instances when CPU > 70% using metric 'Percentage CPU' and operator 'GreaterThan' with threshold 70
B. Set a rule to decrease instances when CPU > 70%
C. Set a rule to add instances when CPU < 70% using metric 'Percentage CPU' and operator 'LessThan' with threshold 70
D. Set a rule to add instances when memory usage > 70% ignoring CPU metrics

Solution

  1. Step 1: Identify correct metric and operator

    The autoscale rule should trigger when CPU usage is greater than 70%, so metric 'Percentage CPU' and operator 'GreaterThan' are correct.
  2. Step 2: Confirm action to add instances

    The rule must add instances when the condition is met, not decrease or use wrong metrics.
  3. Final Answer:

    Set a rule to add instances when CPU > 70% using metric 'Percentage CPU' and operator 'GreaterThan' with threshold 70 -> Option A
  4. Quick Check:

    CPU > 70% triggers add instances [OK]
Hint: Match metric and operator to condition exactly [OK]
Common Mistakes:
  • Using 'LessThan' instead of 'GreaterThan'
  • Confusing CPU with memory metrics
  • Setting decrease action instead of add
3. Given this autoscale rule for a VM Scale Set:
{
  "metricTrigger": {
    "metricName": "Percentage CPU",
    "operator": "GreaterThan",
    "threshold": 80
  },
  "scaleAction": {
    "direction": "Increase",
    "value": "2"
  }
}

What happens when CPU usage goes above 80%?
medium
A. The VM Scale Set decreases by 2 instances
B. The VM Scale Set increases by 2 instances
C. The VM Scale Set stays the same
D. The VM Scale Set increases by 1 instance

Solution

  1. Step 1: Analyze metric trigger

    The rule triggers when CPU usage is greater than 80%.
  2. Step 2: Analyze scale action

    The action is to increase the VM count by 2 instances.
  3. Final Answer:

    The VM Scale Set increases by 2 instances -> Option B
  4. Quick Check:

    CPU > 80% triggers increase by 2 [OK]
Hint: Look for 'Increase' and 'value' in scaleAction [OK]
Common Mistakes:
  • Confusing increase with decrease
  • Ignoring the value number
  • Assuming default increase of 1
4. You configured an autoscale rule to add 1 instance when CPU usage is above 60%, but the VM Scale Set never scales out. What is the most likely error?
medium
A. The metric name is misspelled or incorrect
B. The scale action direction is set to 'Decrease'
C. The threshold is set to 10 instead of 60
D. The VM Scale Set has no instances initially

Solution

  1. Step 1: Check metric name correctness

    If the metric name is wrong, the rule never triggers because it can't read CPU usage.
  2. Step 2: Verify other options

    Direction 'Decrease' would scale down, threshold 10 is too low but would still trigger, and initial instances are usually at least one.
  3. Final Answer:

    The metric name is misspelled or incorrect -> Option A
  4. Quick Check:

    Wrong metric name blocks scaling [OK]
Hint: Always verify metric names exactly match Azure docs [OK]
Common Mistakes:
  • Setting wrong scale direction
  • Ignoring metric name spelling
  • Assuming zero initial instances
5. You want to configure a VM Scale Set to maintain between 3 and 10 instances. It should add 2 instances when average CPU is above 75% and remove 1 instance when CPU is below 30%. Which setup correctly achieves this?
hard
A. Set minimum 5, maximum 15 instances; add 2 when CPU < 30%; remove 1 when CPU > 75%
B. Set minimum 1, maximum 5 instances; add 1 when CPU > 75%; remove 2 when CPU < 30%
C. Set minimum 3, maximum 10 instances; add 1 when CPU > 30%; remove 2 when CPU < 75%
D. Set minimum 3, maximum 10 instances; add 2 when CPU > 75%; remove 1 when CPU < 30%

Solution

  1. Step 1: Confirm instance limits

    The requirement is minimum 3 and maximum 10 instances, so only Set minimum 3, maximum 10 instances; add 2 when CPU > 75%; remove 1 when CPU < 30% matches this.
  2. Step 2: Check autoscale rules

    Set minimum 3, maximum 10 instances; add 2 when CPU > 75%; remove 1 when CPU < 30% adds 2 instances when CPU > 75% and removes 1 when CPU < 30%, exactly as required.
  3. Final Answer:

    Set minimum 3, maximum 10 instances; add 2 when CPU > 75%; remove 1 when CPU < 30% -> Option D
  4. Quick Check:

    Limits and rules match requirements [OK]
Hint: Match min/max and scale rules exactly to requirements [OK]
Common Mistakes:
  • Mixing up CPU thresholds for add/remove
  • Setting wrong min or max instance counts
  • Reversing scale directions
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard