i need to resume a replication between two hyper-V hosts that has long been broken but the IDs of the old copies are still somewhere in the receiving host and so it will not allow me to recreate the replication. Where can I find these ghost IDs and how can I delete them?

To resume a broken replication between two Hyper-V hosts where the old replication IDs are lingering

To resume a broken replication between two Hyper-V hosts where the old replication IDs are lingering on the receiving host, you can manually remove these "ghost" replication records from the receiving host to allow a fresh replication setup. Here’s a step-by-step guide:

Step 1: Stop the Current Replication (if partially working)

If the replication is in a failed state but still visible, stop it using the Hyper-V Manager or PowerShell:

  1. Using Hyper-V Manager:

    • Open Hyper-V Manager on the receiving host.
    • Right-click on the replicated virtual machine.
    • Select Replication > Remove Replication.
  2. Using PowerShell:

    Stop-VMReplication -VMName "YourVMName"
    Remove-VMReplication -VMName "YourVMName"
    

Step 2: Check for Remaining Replication Metadata

The replication metadata may not have been fully cleaned, and this is where the ghost IDs can still reside.

  1. Open PowerShell on the receiving host.
  2. Run the following command to check for any replication metadata that may still exist:
    Get-WmiObject -Namespace root\virtualization\v2 -Query "Select * from Msvm_ReplicationServiceSettingData"
    
    This command will list any remaining replication settings, including the Replication Relationship information.

Step 3: Remove Stale Replication Data (via WMI or PowerShell)

If you find replication entries related to the ghost replication setup, remove them using:

  1. Delete the stale replication object using PowerShell:

    Get-WmiObject -Namespace root\virtualization\v2 -Query "Select * from Msvm_ReplicationServiceSettingData" | Remove-WmiObject
    
  2. Clear VMMS Replication Configuration: Sometimes the configuration for replication might persist in the VMMS service. You can reset this by restarting the Hyper-V Virtual Machine Management service (VMMS):

    Restart-Service vmms
    

Step 4: Clean Up the Hyper-V Replica Broker Configuration (if used in a cluster)

If you're using Hyper-V Replica in a cluster environment, check the Hyper-V Replica Broker role for any stale configurations:

  1. In Failover Cluster Manager, go to Roles and look for the Hyper-V Replica Broker.
  2. Remove any stale VM replication configurations that are linked to the failed replication attempt.

Step 5: Recreate the Replication

After cleaning up the old replication settings, you should be able to start a fresh replication setup. You can use either the Hyper-V Manager or PowerShell:

  1. Using Hyper-V Manager:

    • Right-click the VM > Replication > Enable Replication.
  2. Using PowerShell:

    Start-VMInitialReplication -VMName "YourVMName"
    

This should clear any lingering issues from the old replication and allow you to set up a new replication without conflict.

Add comment