Virtual Machines
General Information
Limitations:
- 20 VMs per region per subscription. Support ticket can increase limits.
Disk types:
- managed disks: managed by Azure. Up to 4TB.
- unmanaged disks: user is responsible for the storage accounts. Single account supports up to 20,000 input/output operations per second (~ 40 standards VHDs at full utilisation).
Get VM image list with the following command:
az vm image list
Virtual Machine Extensions
- Custom Script Extension - run custom scripts when the VM is provisioned.
- PowerShell Desired State Configuration Extension - sets up PowerShell DSC.
- Azure Diagnostics Extension - configures VM to collect diagnostics data.
Azure supports cloud-init for Linux VMs that support it. Works with all major automation tooling like:
- Ansible
- Chef
- SaltStack
- Puppet
Availability Zones
Availability zone is a physically separate zone, within an Azure region. There are three Availability Zones per Azure region.
There are two categories of services that support Availability Zones:
- Zonal services - a resource pinned to a specific zone, or
- Zone-redundant services - replicates automatically across zones.
Availability Sets
Allows Azure to understand how to build application for redundancy and availability. Composed of:
- fault domain (FDs) - logical group of hardware that shares common power source and network switch (similar to a rack within a datacentre).
- upgrade domain (UDs) - logical group of hardware that can undergo maintenance (only one upgrade domain at a time in no particular order).
Scale Sets
Allows creation of a group of load balanced VMs that are scaled automatically.
Load Balancer
Uses Layer-4 (TCP, UDP) load balancing. Health probe monitors each VM on a given port. VMs are connected to a load balancer with their network interface card (NIC).
Load balancer rules for specific ports and protocols are defined to control the flow of traffic to VMs.
VM Sizes
- General purpose (A-series, B-series, D-series)
- Compute optimised (F-series)
- Memory optimised (E-series, D-series, G-series, M-series)
- Storage optimised (L-series)
- GPU (N-series)
- High performance compute (H-series)
Upload Windows Image to Azure
Azure supports both generation 1 and generation 2 VMs that are in VHD file format and that have a fixed-size disk. The maximum size allowed for the IS VHD on a generation 1 VM is 2 TB.
VHDX file can be converted to VHD, dynamically expanding disk to a fixed-size disk, but VM generation cannot be changed.
Az CLI
Create a new resource group:
az group create --name az204-vm-rg --location uksouth
Create a Linux VM:
az vm create `
--resource-group az204-vm-rg `
--name az204vm `
--image UbuntuLTS `
--generate-ssh-keys `
--admin-username pavels
Open port 80
:
az vm open-port --resource-group az204-vm-rg --name az204vm --port 80
Remove created resource group:
az group delete --name az204-vm-rg --yes