Exporting Site Recovery Manager configuration data through the user interface fails with the error Duplicate Key
search cancel

Exporting Site Recovery Manager configuration data through the user interface fails with the error Duplicate Key

book

Article ID: 312723

calendar_today

Updated On:

Products

VMware Live Recovery

Issue/Introduction

Symptoms:
  1. You are unable to export SRM Configuration data through either SRM sites (Local/Remote)
  2. There are many VM templates in vCenter inventory
  3. You find many cloned VM templates in vCenter inventory 

Environment

VMware Site Recovery Manager 8.x

Cause


Export Fails with an Error About a Duplicate Key

The problem can occur when a virtual machine and a virtual machine template in one of the vCenter Server inventories have the same INSTANCE_UUIDs. The virtual machine and the virtual machine template must have different INSTANCE_UUID values. The l_ prefix in the error message means that the objects with the same INSTANCE_UUIDs are in the inventory of the local site. An r_ prefix in the error message means that the objects with the same INSTANCE_UUIDs are in the inventory of the remote site. The local site is the site from which the export operation is initiated, the remote site is the other site in the Site Recovery Manager pair. The end part of the error message vm-123456 represents the ManagedObjectReference value of one of the vCenter Server objects.

Resolution

If there is only one duplicate, it can be fixed by removing one of the duplicates from the vCenter inventory.

Inventory Object can be checked via PowerCLi

Using PowerCLI

Download and install PowerCLI from PowerShell.

Run the commands below on one or all vCenters in linked mode to find the (vm-xxxx) MoRef ID you see in the error.
The process of finding the VM MoRef ID thru PowerCLI may have to be repeated multiple times depending on the number of times you see the error with different VM MoRef IDs while exporting the configuration data.

Here's an example :

Windows PowerShell

Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\User> Connect-VIServer 192.168.0.4
Name             Port        User
---- --                 -- -          ---
192.168.0.4  443        VSPHERE.LOCAL\Administrator

PS C:\Users\User> Get-VM | Sort-Object ID | ft -Property Name,ID -AutoSize
Name                                             Id
----                                                   --
App1                                              VirtualMachine-vm-123
Windows Template (35GB)        VirtualMachine-vm-124
WebApp                                        VirtualMachine-vm-1879
FileServ                                          VirtualMachine-vm-1456