Error: Duplicate key host when adding VMs or reprotecting in vSphere Replication
search cancel

Error: Duplicate key host when adding VMs or reprotecting in vSphere Replication

book

Article ID: 390498

calendar_today

Updated On:

Products

VMware Live Recovery

Issue/Introduction

Symptoms:

  • Unable to Add VMs to Enhanced Replications.

Error: "Unable to retrieve enhanced replication mappings data"
"A Runtime error occurred in the vSphere Replication Management Server. Exception deails: 'Duplicate key host-#### (attempted merging values 30004.0 and 30004.0)'.

  • Unable to reprotect recovered VMs. Reprotect operations fail with the following error:

"Unable to reverse replication for the virtual machine 'vm_name'. A runtime error occurred in the vSphere Replication Management Server. Exception details: 'Duplicate key host-## (attempted merging values com.vmware.hms.db.entities.HbrServerEntity: MoId = HBRSRV-44fd0565-ace4-448b-b0b8-######### and com.vmware.hms.db.entities.HbrServerEntity: MoId = HBRSRV-e563cd03-fe0a-40d8-807e-#########)'. The operation is not allowed in the current state."

  • Duplicate host entries appear under replication servers sections:





  • Validation of hms.log confirms that the workflow fails because multiple vSphere Replication Server entries exist for the same ESXi host, resulting in a duplicate key condition during replication processing.

    Log Locations have chaged betwwen versions. 

    For VLSR  lower then 9.0.3 /opt/vmware/hms/logs/hms.log
    For  VLSR 9.0.3 and higher /var/log/vmware/hms/hms.####.log

####-##-## ##:##:##.### ERROR response.filter.I18nActivationResponseFilter [tcweb-2] (..hms.fault.ExceptionToFaultConverter) {operationID=40b41651-d19d-49d7-9652-0bc9aca88478-reprotect:mx:gn:m4-HMS-1393195} [] | Fault conversion needed. Method 'getReverseReplicationInfo' cannot throw
com.vmware.vim.binding.vim.fault.InvalidState: Duplicate key host-## (attempted merging values com.vmware.hms.db.entities.HbrServerEntity: MoId = HBRSRV-44fd0565-ace4-448b-b0b8-######## and com.vmware.hms.db.entities.HbrServerEntity: MoId = HBRSRV-e563cd03-fe0a-40d8-807e-########)

 

Environment

  • VMware vSphere Replication 9.x
  • VMware Live Recovery 9.x

Cause

The issue is caused by a data integrity collision within the vSphere Replication embedded database (vrmsdb), where stale, orphaned metadata records from previously decommissioned hypervisor hosts or replica servers remain trapped in the hbrserverentity and hbrtagentity lookup tables.

When individual compute nodes (replication endpoints) are removed from a vCenter inventory or decommissioned, the Replication appliance should systematically clean up all corresponding database records to maintain environment consistency. If an unexpected service shutdown, a rapid execution trace race condition, or an improper host removal occurs, these rows can persist as detached "ghost" definitions.

  • The VRMS database contains multiple records for the same ESXi host (host-##). During reprotect, vSphere Replication attempts to identify the replication server associated with the host but encounters multiple matching entries, resulting in a duplicate key exception.

    • This condition is commonly introduced when:
      • ESXi hosts are removed or disconnected while replications are active.
      • Stale replication server records are not cleaned up correctly.
      • Database inconsistencies remain after upgrades, reconfigurations, or replication server changes.

    • As a result, reverse replication cannot be created and the reprotect operation fails.

 

Resolution

If the symptoms and log entries described in this article match your environment, and the cause has been confirmed, contact Broadcom Support for assistance. The resolution requires validation of the environment and application of the appropriate corrective action.