Hello Luis Lucas,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are having error while replicating Hyper-v VM to Azure site recovery.
To address the issue of re-enabling Azure Site Recovery (ASR) replication for recreated VMs on Hyper-V hosts, follow these detailed steps. The problem is from outdated MARS agent versions and possible WMI repository corruption. The below solution provides a comprehensive approach to resolving your ASR replication issues while ensuring future stability.
- The error message indicates that the installed MARS agent version is outdated. Follow these steps to update it:
- Uninstall the Existing Agent by Navigate to the Control Panel on your Hyper-V host and uninstall the current version of the MARS agent.
- Download and Install the Latest Version:
- In the Azure portal, go to Recovery Services Vault > Site Recovery Infrastructure > Hyper-V Sites.
- Select your Hyper-V site and download the MARS agent installer.
- Install the agent on your Hyper-V host and verify the installed version matches the expected version mentioned in the error message.
- A corrupted WMI repository can interfere with ASR processes. You will need to rebuild it using the following steps:
- Open Command Prompt with administrative privileges.
- Run these commands sequentially in CMD:
cd %windir%\system32\wbem mofcomp.exe cimwin32.mof mofcomp.exe rsop.mof net stop winmgmt net start winmgmt
mofcomp.exe
commands recompile essential WMI files, restoring a healthy repository. Then, restarting the WMI service ensures the updated repository is used. - About clearing existing ASR protection settings manually, you can reset the replication configuration for recreated VMs.
- In the Azure portal:
- Navigate to Recovery Services Vault > Site Recovery Infrastructure.
- Unregister the affected Hyper-V host.
- On the Hyper-V host:
- Remove local ASR settings using PowerShell:
Remove-Item -Recurse -Force "C:\Program Files\Azure Site Recovery"
- Restart the Hyper-V host to apply changes.
- Remove local ASR settings using PowerShell:
- In the Azure portal:
- After updating the MARS agent and clearing settings, reconfigure ASR to enable replication.
- Register the Hyper-V Host:
- Launch the Azure Site Recovery Configuration Server setup wizard on your Hyper-V host.
- Provide the vault registration key downloaded from the Azure portal and complete the registration process.
- Enable Replication:
- In the Azure portal, go to the Recovery Services Vault.
- Navigate to the VMs tab, select the recreated VMs, and click Enable Replication.
- Follow the wizard to configure replication settings.
- Register the Hyper-V Host:
- Ensure all components are functioning correctly by:
- Verify MARS Agent Version while Run the following command on the Hyper-V host in CMD:
"C:\Program Files\Microsoft Azure Recovery Services Agent\bin\MARSAgentVersion.exe"
- Confirm that the displayed version matches the required version.
- Verify MARS Agent Version while Run the following command on the Hyper-V host in CMD:
- At this stage ensure you Test WMI Functionality by using WMI Tester (
wbemtest.exe
): Open WMI Tester, connect to\\.\root\cimv2
, and run a query such as:SELECT * FROM Win32_ComputerSystem
- In the Azure portal, go to Recovery Services Vault > Site Recovery Jobs. Review logs for detailed information on replication status and potential issues to track the progress and diagnose any errors during replication setup.
This is an alternative solution, if the issue persists, consider the following options:
- Reset ASR Configuration:
- Remove all related resources in the Azure portal.
- Re-register the Hyper-V hosts and recreate replication configurations from scratch.
- Verify Network Connectivity:
- Ensure the Hyper-V host has a stable network connection to Azure, without firewalls or proxies blocking communication.
- Contact Microsoft Support by open a support ticket, providing logs from both the Azure portal and the Hyper-V host for in-depth analysis.
To read more about the solution provided:
- https://learn.microsoft.com/en-us/azure/backup/backup-azure-mars-overview
- https://learn.microsoft.com/en-us/azure/site-recovery/azure-to-azure-troubleshoot-errors
- https://learn.microsoft.com/en-us/windows/win32/wmisdk/rebuilding-the-wmi-repository
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.