Azure Virtual Machines

Azure Virtual Machines

Azure Virtual Machines (VMs)

Overview

Azure Virtual Machines are on-demand, scalable computing resources that provide full control over the operating system, storage, and networking. They are ideal when you need more flexibility than Platform as a Service (PaaS) offerings like Azure App Service.

Azure VMs are part of Infrastructure as a Service (IaaS), where computing infrastructure is provisioned over the internet and billed based on usage.


IaaS Business Scenarios

Azure Virtual Machines are commonly used for:

  • Test and Development

    • Rapid provisioning and teardown of environments

    • Cost-effective scaling for dev/test workloads

  • Website Hosting

    • Often more economical than traditional hosting

    • Full control over server configuration

  • Storage, Backup, and Disaster Recovery

    • No capital investment in hardware

    • Simplified backup and compliance management

  • High-Performance Computing (HPC)

    • Used for simulations, modeling, and scientific workloads

    • Examples: climate modeling, protein folding, financial analysis

  • Big Data Analytics

    • Supports massive datasets requiring high processing power

  • Extended Datacenter

    • Add capacity without expanding physical infrastructure

    • Seamless connectivity with on-premises networks


Virtual Machine Planning Checklist

Before provisioning a VM, consider:

  1. Network configuration

  2. VM naming conventions

  3. Deployment location (region)

  4. VM size selection

  5. Pricing model

  6. Storage requirements

  7. Operating system selection


Start with the Network

  • Azure VMs connect through Virtual Networks (VNets)

  • Resources in the same VNet can communicate privately

  • External access (internet or on-premises) must be explicitly configured

  • Network address ranges and subnets are difficult to change later, so plan carefully


Naming the VM

VM names:

  • Become the OS computer name

  • Are difficult to change after deployment

  • Max length:

    • Windows: 15 characters

    • Linux: 64 characters

Recommended naming elements:

Element Example Purpose
Environment dev, prod, qa Identifies environment
Location uw, ue Azure region
Instance 01, 02 Multiple servers
Product/Service service Application supported
Role web, sql Server role

Example: devusc-webvm01


Location and Pricing Considerations

When choosing a region:

  • Place VMs close to users for better performance

  • Meet legal, compliance, or data residency requirements

  • Be aware:

    • Not all VM sizes are available in every region

    • Prices vary between regions


Azure VM Pricing Model

Azure VM costs consist of two independent charges:

1. Compute Costs

  • Billed per minute

  • Charged only when VM is running

  • No compute charge when VM is stopped and deallocated

  • Windows VMs include OS licensing

  • Linux VMs are cheaper (no license cost)

Compute pricing options:

  • Consumption-based (Pay-as-you-go)

    • Ideal for short-term or unpredictable workloads

  • Reserved VM Instances (1 or 3 years)

    • Up to 72% savings

    • Best for always-on workloads and predictable budgets

2. Storage Costs

  • Charged regardless of VM state

  • Applies even when VM is stopped


Virtual Machine Sizing

Azure offers predefined VM sizes optimized for different workloads:

VM Categories

VM Type Use Case
General Purpose Dev/test, small databases, web servers
Compute Optimized High CPU workloads, batch processing
Memory Optimized Databases, in-memory analytics
Storage Optimized High disk throughput and IOPS
GPU AI, ML, rendering, video processing
High Performance Compute Scientific and compute-intensive workloads

Resizing Virtual Machines

  • VM sizes can be changed as workload needs evolve

  • Some resizing requires:

    • VM reboot

    • Temporary downtime

    • Possible IP address change

  • Stopping and deallocating a VM allows access to all available sizes in the region


Virtual Machine Disks

Every Azure VM includes:

Operating System Disk

  • Pre-installed OS

  • Max size: 2,048 GiB

  • Appears as:

    • Windows: C: drive

  • Uses SATA interface

Temporary Disk

  • Not managed

  • Used for swap/page files only

  • Data may be lost during maintenance or redeployment

  • Appears as:

    • Windows: D: drive

    • Linux: /dev/sdb mounted to /mnt

⚠️ Do not store critical data on the temporary disk

Data Disks

  • Managed disks used for persistent data

  • Max size per disk: 4,095 GiB

  • Attached as SCSI disks

  • Number depends on VM size


Azure Disk Storage Options

Managed Disks (Recommended)

  • Azure handles storage accounts and availability

  • Disk types:

    • Ultra SSD

    • Premium SSD

    • Standard SSD

    • Standard HDD

  • Required for 99.95% SLA on single-instance VMs

Unmanaged Disks

  • Legacy approach

  • Customer manages storage accounts and VHD files

  • Not recommended for new deployments


Performance and Storage Guidance

  • Use Premium SSD or Ultra SSD for high IOPS workloads

  • Use Standard HDD/SSD for cost savings when performance is not critical

  • Premium Storage supports:

    • Up to 80,000 IOPS per VM

    • Up to 2,000 MB/s throughput