"Duplicate key null" error when trying to copy a virtual machine within the same vApp
search cancel

"Duplicate key null" error when trying to copy a virtual machine within the same vApp

book

Article ID: 320411

calendar_today

Updated On: 10-26-2023

Products

VMware Cloud Director

Issue/Introduction

Symptoms:
  • "Duplicate key null" error when trying to copy a virtual machine within the same vApp.
  • Cannot copy a VM within the same vApp
  • [ xxx ] Duplicate key null (attempted merging values com.vmware.vcloud.api.presentation.entity.vapp.NetworkConnection@zzzz[connected=false,ipAddress=,ipAddressingMode=NONE,ipType=,macAddress=,needsCustomization=false,networkAdapterType=VMXNET3,networkConnectionIndex=0,secondaryIpAddress=,secondaryIpAddressingMode=,secondaryIpType=,vappNetworkName=] and com.vmware.vcloud.api.presentation.entity.vapp.NetworkConnection@yyyy[connected=false,ipAddress=,ipAddressingMode=NONE,ipType=,macAddress=,needsCustomization=false,networkAdapterType=VMXNET3,networkConnectionIndex=1,secondaryIpAddress=,secondaryIpAddressingMode=,secondaryIpType=,vappNetworkName=])


Cause

This issue occurs due to a bug in code, in which the copied VM will have additional NICs attached which are duplicates of the existing NICs.
The lookup in Cloud Director will match on MAC, which has since been duplicated, leading to the error.

Resolution

This is a known issue in VMware Cloud Director 10.4.2.1.


Workaround:

To workaround the issue, follow either of the workarounds specified below:

  1. Power off the virtual machine before performing the task.
    1. This ensures a different code flow runs, which does not cause the duplicate conflict specified above.
  2. Remove the duplicate NICs from the virtual machine before performing the task.
    1. As there are no duplicate MACs, the lookup will no longer fail.