How To Disable Protection For HyperV VMs To AzureSiteRecovery #ASR #Azure #CDCGermany #MVPbuzz

3 Min. Read

Introduction

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:

  1. 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.
  2. 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)
  3. 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.

Learn more

Do you want to learn more about Azure Backup and how to create a hybrid-cloud backup solution using DPM and Azure Backup Server?

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.

https://charbelnemnom.com/2018/02/speaking-at-cloud-datacenter-conference-germany-2018-cdcgermany/

__
Thank you for reading my blog.

If you have any questions or feedback, please leave a comment.

-Charbel Nemnom-

Previous

VM agent is unable to communicate with the Azure Backup Service #Azure @AzureBackup #CDCGermany #MVPbuzz

How To Create Recovery Services Vault in Azure with PowerShell #AzureBackup #CDCGermany

Next

Let me know what you think, or ask a question...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to Stay in Touch

Never miss out on your favorite posts and our latest announcements!

The content of this website is copyrighted from being plagiarized!

You can copy from the 'Code Blocks' in 'Black' by selecting the Code.

Please send your feedback to the author using this form for any 'Code' you like.

Thank you for visiting!