40 minutes
rg-az104-lab09,region: East US. Review + create > Create.
rg-az104-lab09, Name: vnet-lab09, Address space: 10.40.0.0/16.
Subnets tab: subnet-vms with range 10.40.1.0/24. Create.
An Availability Set must be specified at VM creation time. You cannot add an existing VM to an Availability Set.
rg-az104-lab09, Name: avset-lab09,
Fault domains: 2, Update domains: 5. Create.
- Virtual machines > Create > Basics: vm-av1, image Ubuntu
22.04 LTS, size StandardB1s, vnet-lab09/subnet-vms. Advanced
tab: set Availability set to avset-lab09. Create.
- Repeat for vm-av2.
maintenance window and power outage protection within the same datacenter.
- Virtual machines > Create > Basics: vm-zone1, image Ubuntu
22.04 LTS, size StandardB1s, vnet-lab09/subnet-vms. Advanced
tab: Availability zone = Zone 1. Create.
- Repeat for vm-zone2, setting zone to Zone 2.
VMs cannot be in both an Availability Set and an Availability Zone —
they're mutually exclusive. Not all regions/sizes support zones.
- Resource group: rg-az104-lab09
- Name: vmss-lab09
- Region: East US
- Image: Ubuntu Server 22.04 LTS
- Size: Standard_B1s
- Initial instance count: 2
- Username: azureuser
- SSH public key: Generate new key pair or use existing
vnet-lab09, Subnet:subnet-vms, Public IP per instance: disabled (or keep default),
Load balancer: create new (e.g., lb-vmss09).
Set autoscale thresholds conservatively (e.g., 70% CPU to scale out, 30% to scale in) to avoid rapid scaling in/out fluctuations.
autoscale (or go to Monitor > Autoscale settings for the VMSS
resource).
- Metric: CPU Percentage
- Operator: Greater than
- Threshold: 70
- Duration: 5 minutes
- Action: Increase instance count by 1
- Metric: CPU Percentage
- Operator: Less than
- Threshold: 30
- Duration: 5 minutes
- Action: Decrease instance count by 1
(to control manually), then set Instance count to 3 > Save.
select all checkboxes > Upgrade (rolls out the new model progressively
based on the upgrade policy).
avset-lab09 contains vm-av1 and vm-av2 (check Availability sets> select the set > Instances)
vm-zone1 in Zone 1, vm-zone2 in Zone 2 (check each VM's Overview> Availability)
vmss-lab09 running with 2+ instances behind load balancer(vmss-lab09 > Instances)
(vmss-lab09 > Scaling)
rg-az104-lab09 > Delete resource group.