AZURE SITE RECOVERY-STEP BY STEP GUIDE
FROM HYPER-V TO AZURE
In this article we will learn how to replicate VM from Hyper-V to Azure and do a failover test.
CREATION OF REQUIRED RESOURCES
Create a Resource Group
Create a Storage Account
Tip: GZRS is not supported. Disable SOFT Delete, which is enabled by default and is not supported in this scenario.
Create a virtual network for the Recovery Services Vault. In this case, all network settings are default.
Create Recovery Services Vault
AZURE SITE RECOVERY SERVICES
After the creation of the Recovery Services Vault navigate to the resource. To replicate Hyper-V machines to Azure, we have three steps:
- Prepare infrastructure
- Enable replication
- Manage Recovery Plan
PREPARE INFRASTRACTURE
Create a Hyper-V site.
Add Hyper-V server to Site.
Download the installer for Microsoft Azure Site Recovery Provider and download the registration key to register a host in a Hyper-V site.
Create a folder on the Hyper-V server and copy the downloaded files to that folder.
Run the installer and provide the registration key that you downloaded in the previous step.
Choose a key file (type of file: vault credential).
Follow the instructions, it’s very simple.
After 20–30 minutes, the server will appear.
Tip: Refresh the screen after some time.
Configure the target settings (target for VM replication). Choose the storage account and network that were created in the previous steps.
Create replication policy.
ENABLE REPLICATION
Choose a source location.
Create a target environment. Choose a resource group, storage account, and virtual network.
Choose the server that you want to replicate to Azure.
Replication settings (set OS type, OS Disk, Disk that you want to replicate and name of the virtual machine that will be created in Azure).
Choose the replication policy that you created in the previous steps.
Replication is enabled successfully.
Replication status
MANAGE RECOVERY PLANS
Create recovery plan
Failover test
Navigate to the replicated server
Select Failover Test.
Choose a source and a target for the failover test. Use the previously created virtual network.
After some time, the failover was executed successfully.
The virtual machine is located in the resource group that we defined in the previous steps.
CONNECT TO VIRTUAL MACHINE
Navigate to the virtual machine. We need to tweak the security group and associate a public IP to access the VM over RDP.
An alternative option is Azure Bastion and Just In Time Access.
PUBLIC IP
Create a public IP
Associate public IP with the NIC (Network Interface Controller).
Choose a public IP and save the configuration.
NETWORK SECURITY GROUP
Add an inbound security rule for the virtual machine (NSG).
This is only an example-opening RDP to the public is extremely dangerous for attacks, and it’s not recommended.
Requirements are met. The connection is working. Now we can connect to our virtual machine.
Cleanup test failover after testing.
Done.
Microsoft documentation: About Azure Site Recovery – Azure Site Recovery | Microsoft Learn
More about conditional access: Conditional Access MFA – Trusted Locations (aljazperovsek.com)