Skip to main content
Version: Next

Task 02: Configure Site Recovery

Runbook Azure

DOCUMENT CATEGORY: Runbook SCOPE: VM replication to Azure for disaster recovery PURPOSE: Configure Azure Site Recovery for Azure Local VMs MASTER REFERENCE: Microsoft Learn - Hyper-V to Azure DR Architecture

Status: Active


Azure Site Recovery (ASR) provides disaster recovery capabilities by replicating Azure Local VMs to Azure. During a disaster, VMs can fail over to Azure and run as Azure VMs until the on-premises environment is restored.

Prerequisites

RequirementDescriptionValidation
Recovery Services VaultAzure vault for ASR (same or different from backup)Created in target Azure region
Azure Storage AccountStandard storage for replicated dataGeneral-purpose v2 or Premium
Azure Virtual NetworkTarget network for failed-over VMsConfigured with appropriate subnets
Outbound ConnectivityCluster nodes to Azure endpointsPorts 443, 9443
Hyper-V IntegrationIntegration components on all VMsCurrent version
Cluster NodesWindows Server 2019 or laterDomain-joined

Variables from variables.yml

VariableConfig PathExample
AZURE_SUBSCRIPTION_NAMEazure.subscription.nameAzure Local Production
AZURE_RESOURCE_GROUPazure.resource_group.namerg-azurelocal-prod-eus2
AZURE_REGIONazure.resource_group.locationeastus2
RECOVERY_VAULT_NAMEdr.recovery_vault_namersv-azl-dal-dr-01
DR_STORAGE_ACCOUNTdr.storage_accountstazldaldr01
DR_VNET_NAMEdr.vnet_namevnet-dr-dal-prod
DR_VNET_CIDRdr.vnet_cidr10.100.0.0/16
DR_SUBNET_NAMEdr.subnet_namesnet-dr-workloads
DR_SUBNET_CIDRdr.subnet_cidr10.100.1.0/24
HYPERV_SITE_NAMEdr.hyperv_site_nameAzureLocal-DAL-Site
REPLICATION_POLICY_NAMEdr.replication_policy_namerep-policy-dal-24hr
DR_RESOURCE_GROUPdr.resource_grouprg-dr-dal-prod-eus2
MANAGEMENT_NETWORK_NAMEnetworking.management.network_namemgmt-vlan100
RECOVERY_PLAN_NAMEdr.recovery_plan_nameRP-CriticalApps-DAL
DR_NOTIFICATION_EMAILdr.notification_emaildr-team@contoso.com

Architecture Overview

Site Recovery uses two main components on Azure Local:

ComponentDescriptionLocation
Azure Site Recovery ProviderOrchestrates replication with ASR serviceEach cluster node
Recovery Services AgentHandles data replication to AzureEach cluster node
VMM Optional

System Center VMM is optional. Azure Local clusters can be registered directly as a Hyper-V site without VMM.

Replication Flow

  1. Initial replication creates VM snapshot and replicates full disks to Azure Storage
  2. Delta replication tracks changes via Hyper-V Replica and sends incremental data
  3. During failover, Azure VMs are created from replicated data
  4. Failback reverses the process after on-premises recovery

Configuration Steps

Step 2.1: Create Recovery Services Vault

  1. Navigate to Create a resourceRecovery Services vault
  2. Configure:
  • Name: {{RECOVERY_VAULT_NAME}}
  • Resource Group: {{AZURE_RESOURCE_GROUP}}
  • Region: {{AZURE_REGION}} (target region for DR)
  1. Click Review + create

Step 2.2: Prepare Azure Resources

Create target resources for failed-over VMs:

  1. Storage Account:
  • Navigate to Storage accountsCreate
  • Name: {{DR_STORAGE_ACCOUNT}}
  • Performance: Standard (or Premium for production)
  • Replication: LRS or GRS based on requirements
  1. Virtual Network:
  • Navigate to Virtual networksCreate
  • Name: {{DR_VNET_NAME}}
  • Address space: {{DR_VNET_CIDR}}
  • Subnet: {{DR_SUBNET_NAME}} with appropriate CIDR

Step 2.3: Create Hyper-V Site

  1. Navigate to Recovery Services vaultSite RecoveryPrepare Infrastructure

  2. Select Protection goal:

  • Where are your machines located? On-premises
  • Where do you want to replicate? To Azure
  • Are your machines virtualized? Yes, with Hyper-V
  • Are you using VMM? No
  1. Create Hyper-V site:
  • Name: {{HYPERV_SITE_NAME}}
  • Click OK

Step 2.4: Download and Install Provider

  1. Download the Azure Site Recovery Provider installer from the vault

  2. Download the vault registration key (valid 5 days)

  3. On each cluster node, install the Provider:

# Run on each cluster node
$InstallerPath = "C:\Temp\AzureSiteRecoveryProvider.exe"
$RegistrationKey = "C:\Temp\VaultCreds.VaultCredentials"

# Install Provider silently
Start-Process -FilePath $InstallerPath `
-ArgumentList "/x:C:\Temp\ASRInstall /q" `
-Wait

# Run setup
Start-Process -FilePath "C:\Temp\ASRInstall\setupdr.exe" `
-ArgumentList "/i" `
-Wait

# Register with vault
$FriendlyName = $env:COMPUTERNAME
$RegistrationCmd = "C:\Program Files\Microsoft Azure Site Recovery Provider\DRConfigurator.exe"

& $RegistrationCmd `
/r /Credentials $RegistrationKey `
/FriendlyName $FriendlyName
  1. Verify registration in Azure Portal → Site Recovery InfrastructureHyper-V Hosts

Step 2.5: Configure Replication Policy

  1. Navigate to vault → Site RecoveryReplication policies
  2. Click Create replication policy
  3. Configure:
SettingRecommended ValueDescription
Name{{REPLICATION_POLICY_NAME}}Policy identifier
Copy frequency5 minutesHow often to replicate changes
Recovery point retention24 hoursHow long to keep recovery points
App-consistent snapshot frequency4 hoursVSS-based snapshots
Initial replication start timeImmediately or scheduledOff-hours recommended
  1. Click OK to create policy

  2. Associate policy with Hyper-V site:

  • Navigate to Site Recovery InfrastructureHyper-V Sites
  • Select site → Replication policy → Associate created policy

Step 2.6: Enable Replication for VMs

  1. Navigate to vault → Replicated itemsReplicate

  2. Configure source:

  • Source: Your Hyper-V site
  • Hyper-V host: Select cluster nodes
  1. Configure target:
  • Subscription: {{AZURE_SUBSCRIPTION_NAME}}
  • Post-failover resource group: {{DR_RESOURCE_GROUP}}
  • Post-failover deployment model: Resource Manager
  • Storage account: {{DR_STORAGE_ACCOUNT}}
  • Azure network: Configure after failover or select {{DR_VNET_NAME}}
  1. Select virtual machines to replicate

  2. Configure VM properties:

  • OS type: Windows/Linux
  • OS disk: Select boot disk
  • Data disks: Select additional disks
  1. Review and enable replication

Step 2.7: Configure Network Mapping

Map on-premises networks to Azure virtual networks:

  1. Navigate to vault → Site Recovery InfrastructureNetwork Mapping
  2. Click Add network mapping
  3. Configure:
  • Source network: {{MANAGEMENT_NETWORK_NAME}}
  • Target network: {{DR_VNET_NAME}}
  1. Repeat for additional networks

Step 2.8: Configure Recovery Plans

Recovery plans orchestrate failover of multiple VMs:

  1. Navigate to vault → Recovery PlansCreate recovery plan
  2. Configure:
  • Name: {{RECOVERY_PLAN_NAME}}
  • Source: Hyper-V site
  • Target: Azure
  • Select items: Choose VMs to include
  1. Customize groups:
  • Group 1: Critical infrastructure (domain controllers)
  • Group 2: Database servers
  • Group 3: Application servers
  • Group 4: Web servers
  1. Add pre/post actions:
  • Scripts to run before/after group failover
  • Manual actions for verification steps

Validation

Verify Replication Health

  1. Navigate to vault → Replicated items
  2. Verify each VM shows:
  • Replication health: Healthy
  • Status: Protected
  • RPO: Within policy threshold

Check Initial Replication

# Monitor initial replication progress
Get-AzRecoveryServicesAsrReplicationProtectedItem |
Where-Object { $_.ReplicationProvider -eq "HyperVReplica2012R2" } |
Select-Object FriendlyName,
@{N='Progress';E={$_.ProviderSpecificDetails.InitialReplicationDetails.InitialReplicationProgressPercentage}},
@{N='Status';E={$_.ProviderSpecificDetails.InitialReplicationDetails.InitialReplicationStatus}}

Validation Checklist

ComponentVerificationExpected Result
Provider installedAll nodes in vaultRegistered and connected
Replication policyPolicy associatedActive on Hyper-V site
VMs replicatingReplicated items listHealthy, Protected
Initial syncProgress percentage100% complete
RPO complianceRPO columnWithin policy threshold

Monitoring

Configure Alerts

  1. Navigate to vault → AlertsAlert rules
  2. Create rules for:
  • Replication health critical
  • RPO threshold breach (e.g., > 30 minutes)
  • Test failover not run in 90 days

Email Notifications

  1. Navigate to vault → Site Recovery Events
  2. Click Email notifications
  3. Configure:
  • Enable notifications: On
  • Recipients: {{DR_NOTIFICATION_EMAIL}}
  • Events: Critical, Warning

Outbound Connectivity Requirements

Ensure firewall allows these URLs:

URLPurpose
*.blob.core.windows.netData replication to storage
login.microsoftonline.comAuthentication
*.hypervrecoverymanager.windowsazure.comSite Recovery service
*.servicebus.windows.netMonitoring and diagnostics

Troubleshooting

SymptomLikely CauseResolution
Provider registration failsConnectivity or expired keyCheck firewall, regenerate key
Initial replication slowNetwork bandwidthSchedule off-hours, check throttling
RPO exceeds thresholdHigh change rate or connectivityIncrease frequency, check network
Resync requiredConnectivity interruptionWill auto-resume; verify network
VM not appearingAgent not installedInstall integration components on VM

Force Resynchronization

If delta replication fails:

  1. Navigate to vault → Replicated items → Select VM
  2. Click Resynchronize
  3. Monitor progress in Jobs

Variables Reference

VariableDescriptionExample
{{HYPERV_SITE_NAME}}Hyper-V site nameAzureLocal-Dallas-Site
{{REPLICATION_POLICY_NAME}}Replication policy nameAzureLocal-5min-RPO
{{DR_VNET_NAME}}DR virtual network namevnet-dr-eastus2-01
{{DR_STORAGE_ACCOUNT}}Replication storage accountstdreastus201

Next Steps

After configuring Site Recovery:

  1. ➡️ Task 3: Test DR Procedures — Validate failover with test failover
  2. Document recovery time objectives (RTO)
  3. Schedule regular test failovers (quarterly recommended)
  4. Create runbooks for failover procedures