Set up disaster recovery for Azure VMs after migration to Azure
Follow this article if you've migrated on-premises machines to Azure VMs using the Site Recovery service, and you now want to get the VMs set up for disaster recovery to a secondary Azure region. The article describes how to ensure that the Azure VM agent is installed on migrated VMs, and how to remove the Site Recovery Mobility service that's no longer needed after migration.
Before you set up disaster recovery, make sure that migration has completed as expected. To complete a migration successfully, after the failover, you should select the Complete Migration option, for each machine you want to migrate.
Each Azure VM must have the Azure VM agent installed. To replicate Azure VMs, Site Recovery installs an extension on the agent.
- If the machine is running version 9.7.0.0 or later of the Site Recovery Mobility service, the Azure VM agent is automatically installed by the Mobility service on Windows VMs. On earlier versions of the Mobility service, you'll install the agent manually.
- For Linux VMs, you must install the Azure VM agent manually. You only need to install the Azure VM agent if the Mobility service installed on the migrated machine is v9.6 or earlier.
If you're running a version of the Site Recovery mobility service earlier than 9.7.0.0, or you have some other need to install the agent manually, do the following:
- Ensure you have admin permissions on the VM.
- Download the VM Agent installer.
- Run the installer file.
To check that the agent is installed:
- On the Azure VM, in the C:\WindowsAzure\Packages folder, you should see the WaAppAgent.exe file.
- Right-click the file, and in Properties, select the Details tab.
- Verify that the Product Version field shows 2.6.1198.718 or higher.
Learn more about agent installation for Windows.
Install the Azure Linux VM agent manually as follows:
- Make sure you have admin permissions on the machine.
- We strongly recommend that you install the Linux VM agent using an RPM or a DEB package from your distribution's package repository. All the endorsed distribution providers integrate the Azure Linux agent package into their images and repositories.
- We strongly recommend that you update the agent only through a distribution repository.
- We don't recommend installing the Linux VM agent directly from GitHub and updating it.
- If the latest agent for your distribution is not available, contact distribution support for instructions on how to install it.
Run this command: ps -e to ensure that the Azure agent is running on the Linux VM.
If the process isn't running, restart it by using the following commands:
- For Ubuntu/Debian:
sudo systemctl enable --now walinuxagent.service
- For other distributions:
sudo systemctl enable --now waagent.service
- Manually uninstall the Mobility service from the Azure VM, using one of the following methods.
- For Windows, in the Control Panel > Add/Remove Programs, uninstall Microsoft Azure Site Recovery Mobility Service/Master Target server. At an elevated command prompt, run:
MsiExec.exe /qn /x {275197FC-14FD-4560-A5EB-38217F80CBD1} /L+*V "C:\ProgramData\ASRSetupLogs\UnifiedAgentMSIUninstall.log"
- For Linux, sign in as a root user. In a terminal, go to /user/local/ASR, and run the following command:
./uninstall.sh -Y
- For Windows, in the Control Panel > Add/Remove Programs, uninstall Microsoft Azure Site Recovery Mobility Service/Master Target server. At an elevated command prompt, run:
- Restart the VM before you configure replication.
- Review troubleshooting for the Site Recovery extension on the Azure VM agent.
- Quickly replicate an Azure VM to a secondary region.