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 

image.png


Environment

VMware Site Recovery Manager 8.x

Cause


Export Fails with an Error About a Duplicate Key - https://docs.vmware.com/en/Site-Recovery-Manager/8.5/com.vmware.srm.install_config.doc/GUID-691534D3-0E1C-47D5-9B9F-75646BB1F5E1.html

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


There are two ways to fix this -

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 or RVTools 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

Using RVTools

https://www.robware.net/rvtools/

You can also use RVTools to generate an excel file of the infrastructure and get the VM MoRef ID thru it and remove the VM template from the inventory.

NOTE: VMware documentation states that you have to delete the VM template from vCenter inventory but I have verified that just removing from vCenter inventory also works. Do what suits you best.