Error: "The VMware Cloud Director entity <vapp_name> already exists" when attempting to create a vApp in VMware Cloud Director
search cancel

Error: "The VMware Cloud Director entity <vapp_name> already exists" when attempting to create a vApp in VMware Cloud Director

book

Article ID: 381578

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • There is an error while creating 2 vapps with same name in same organization and same Virtual Datacenters (VDCs).
  • There is an error while creating 2 vapps with same name in same organization but different VDCs.
  • In creating the second vAPP it throws the error:
    [ ########-####-####-####-############ ] The VMware Cloud Director entity <vapp_name> already exists.
  • You can see the below error from the VCD cell /opt/vmware/vcloud-director/logs/vcloud-container-debug.log:

    ERROR    | pool-jetty-16764121       | JDBCExceptionReporter          | ERROR: duplicate key value violates unique constraint "uk_vm_container_org_vapp_name"  Detail: Key (uniquename)=(########-####-####-####-############|<vapp_name>) already exists. | requestId=########-####-####-####-############,request=POST https://<VCD hostname>/api/vdc/########-####-####-####-############/action/createVm,requestTime=#############,remoteAddress=##.##.##.##:####,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/*+xml;version 38.0

Environment

VMware Cloud Director 10.5.x
VMware Cloud Director 10.6

Cause

The unique key in the database is on the Organization and not on the Org VDC.  In other words, the "uniqueness scope" is on vAPP name at Organization level. Hence, you cannot create vAPPs with same name in same Organization. 

Resolution

You need to create vAPPs with different names inside the same organization.