In This Article
Azure Site Recovery (ASR) is Microsoft’s Disaster Recovery strategy. It keeps workloads safe and recoverable through replication from on-premises servers, such as physical servers, Hyper-V based VMs and VMware-based VMs. Although ASR is designed for disaster recovery, Azure Site Recovery can also be used to migrate virtual machines to the cloud an approach known as “Lift and Shift“.
So what is the difference between both scenarios?
- For disaster recovery, you replicate machines on a regular basis to Azure. When an outage occurs (on-premises), you fail the machines over from the primary site to the secondary Azure site, and access them from there. When the primary site is available again, you fail back from Azure.
- For migration, you replicate on-premises machines to Azure. Then you fail the VM over from on-premises to Azure and complete the migration process. There’s no failback involved. The key feature of the migration scenario is, ASR will convert automatically all your (VHDX) on-premises to (VHD) and upload them to Azure Storage.
As a fully integrated offering, Azure Backup and Azure Site Recovery are automatically updated with new Azure features as they’re released. Minimize recovery issues by sequencing the order of multi-tier applications running on multiple virtual machines from the Azure portal. Ensure compliance by testing your disaster recovery plan without impacting production workloads or end users. And keep on-premises applications available during outages with automatic recovery to Azure.
I was recently migrating Hyper-V virtual machines from on-premises to Azure, and after a successful planned failover, I need to clean and disable the protected virtual machines to Azure.
Disable protection Hyper-V to Azure
During the migration phase, you will perform a planned failover. A planned failover is a zero data loss failover option. When a planned failover is triggered, first the source virtual machines on-premises are shut-down, the latest data is synchronized to Azure and then a failover is triggered.
When the virtual machines are running in Azure, the source virtual machines on-premises are still protected to Azure (the replication is constant), but they are in Off state.
If you are familiar with Hyper-V Replica, ASR leverages the same technology. However, there is no option to remove the replication for the VM from Hyper-V Manager, because when a VM is protected using ASR, all the operations must be done from Azure Site Recovery and not on-premises.
Now to disable protection for a Hyper-V virtual machine to Azure, take the following steps:
- First we need to disable the replication. Open Azure Recovery Service vault, under Protected Items, select Replicated Items, right-click the virtual machine and select Disable Replication.
- In Disable Replication, you can select one of the following two options:
- Disable replication and remove (Recommended) – This will remove the replicated item from Azure Site Recovery and the replication for the virtual machine on-premises will stop. Replication configuration on-premises will be cleaned up automatically. Azure Site Recovery billing for the machine will stop as well.
- Remove – This option is supposed to be used only if the source Hyper-V environment on-premises is deleted or not accessible anymore (not connected). This removes the replicated item from Azure Site Recovery (billing is stopped). Replication configuration on the on-premises virtual machine will not be cleaned up, you need to do that manually on the Hyper-V host on-premises by running the following PowerShell script as administrator:
$vmName = "VMName" $vm = Get-WmiObject -Namespace "root\virtualization\v2" -Query "Select * From Msvm_ComputerSystem Where ElementName = '$vmName'" $replicationService = Get-WmiObject -Namespace "root\virtualization\v2" -Query "Select * From Msvm_ReplicationService" $replicationService.RemoveReplicationRelationship($vm.__PATH)
- You need to repeat the same process as described in Step 2 for every protected VM to Azure.
Note: The procedure above is only for replicating Hyper-V VMs to Azure without a VMM server. If you are replicating your virtual machines using the System Center VMM to Azure scenario, then follow the instructions described here.
Then make sure to join me next week at CDC Germany in Hanau where I will cover in details the benefits of using Azure Backup to protect on-premises workloads. I Also have a surprise in store for you, thanks to Altaro Software! I’ll tell you more about how you can WIN during my talk!
There are still a few seats left for the conference, please make sure to register now #CDCGermany2018.
Thank you for reading my blog.
If you have any questions or feedback, please leave a comment.