Error replicating Hyper-v VM to Azure site recovery

Luis Lucas 0 Reputation points
2024-12-18T18:27:44.9866667+00:00

Hello,

I have a hyper-v with multiple hyper-v hosts and VMs.

The replication to azure site recovery was working fine.

I recreated some VMs and now i cant re-enable the replication.

I have already disbled the replication, and removed the hyper-v hosts. Installed the new AzureSiteRecoveryProvider.exe and key in the Hyper-v hosts, but i cant enable recplication.

I have this error in the Azure Portal:

Error Message: Enabling protection couldn't be completed for the virtual machine.

Provider error: Provider error code: 31408

Provider error message: Failed to fetch the version of Microsoft Azure Recovery Services Agent installed on the Hyper-V host server MyHyperHost Error: Provider not found

Provider error possible causes:

It is possible that Registry provider of WMI is corrupted.

Provider error recommended action:

Build the repository using MOF compiler and retry the operation.

Possible causes Check the Provider errors for more details.

Recommendation:

Manually clear protection settings.

For details see http://go.microsoft.com/fwlink/?LinkId=398534.

Related links http://go.microsoft.com/fwlink/?LinkId=398534

And in the Hyper-v host i have this error:

InnerException.Type: System.ComponentModel.Win32Exception, InnerException.Message: The specified service does not exist as an installed service

InnerException.StackTrace:

Checking for MARS agent installation

Installing MARS agent

MARS agent installation verification failed. Expecting Version 2.0.9940.0 Found 2.0.8673.0

What are the steps i need to do to enable replication again?

Azure Site Recovery
Azure Site Recovery
An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.
739 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,774 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 14,551 Reputation points
    2024-12-18T20:39:59.1433333+00:00

    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.

    1. The error message indicates that the installed MARS agent version is outdated. Follow these steps to update it:
      1. Uninstall the Existing Agent by Navigate to the Control Panel on your Hyper-V host and uninstall the current version of the MARS agent.
      2. Download and Install the Latest Version:
        1. In the Azure portal, go to Recovery Services Vault > Site Recovery Infrastructure > Hyper-V Sites.
        2. Select your Hyper-V site and download the MARS agent installer.
        3. Install the agent on your Hyper-V host and verify the installed version matches the expected version mentioned in the error message.
    2. A corrupted WMI repository can interfere with ASR processes. You will need to rebuild it using the following steps:
      1. Open Command Prompt with administrative privileges.
      2. Run these commands sequentially in CMD:
              cd %windir%\system32\wbem
                 mofcomp.exe cimwin32.mof
                 mofcomp.exe rsop.mof
                 net stop winmgmt
                 net start winmgmt
        
      NOTE: The mofcomp.exe commands recompile essential WMI files, restoring a healthy repository. Then, restarting the WMI service ensures the updated repository is used.
    3. About clearing existing ASR protection settings manually, you can reset the replication configuration for recreated VMs.
      1. In the Azure portal:
        1. Navigate to Recovery Services Vault > Site Recovery Infrastructure.
        2. Unregister the affected Hyper-V host.
      2. On the Hyper-V host:
        1. Remove local ASR settings using PowerShell: Remove-Item -Recurse -Force "C:\Program Files\Azure Site Recovery"
        2. Restart the Hyper-V host to apply changes.
    4. After updating the MARS agent and clearing settings, reconfigure ASR to enable replication.
      1. Register the Hyper-V Host:
        1. Launch the Azure Site Recovery Configuration Server setup wizard on your Hyper-V host.
        2. Provide the vault registration key downloaded from the Azure portal and complete the registration process.
      2. Enable Replication:
        1. In the Azure portal, go to the Recovery Services Vault.
        2. Navigate to the VMs tab, select the recreated VMs, and click Enable Replication.
        3. Follow the wizard to configure replication settings.
    5. Ensure all components are functioning correctly by:
      1. 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"
      2. Confirm that the displayed version matches the required version.
    6. 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
    7. 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:

    1. Reset ASR Configuration:
    • Remove all related resources in the Azure portal.
    • Re-register the Hyper-V hosts and recreate replication configurations from scratch.
    1. Verify Network Connectivity:
    • Ensure the Hyper-V host has a stable network connection to Azure, without firewalls or proxies blocking communication.
    1. 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:

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.