Error:"The name '<VM name>' already exists." when reattaching a disk after expansion.
search cancel

Error:"The name '<VM name>' already exists." when reattaching a disk after expansion.

book

Article ID: 325650

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Reattaching a disk to the virtual machine fails with the error:

[########-####-####-####-############] null - The name '<VM name>' already exists.

  • There is no VM present in the Cloud director with this name.
  • A named disk is available in the Cloud director with this name.
  • A virtual machine with the same name is present in vCenter inventory.
  • PVC named disk shows Unknown status.
  • The following error message is visible after copying/pasting the message from the COPY DEBUG INFORMATION button on the failing task.

    com.vmware.vcloud.common.activity.RetryableOperationException:null
    at com.vmware.vcloud.val.internal.impl.CreateVmActivity$CreateVmPhase.createVm(CreateVmActivity.java:382)
    at com.vmware.vcloud.val.internal.impl.CreateVmActivity$CreateVmPhase.invoke(CreateVmActivity.java:305)
    at com.vmware.vcloud.activity.executors.ActivityRunner.runPhase(ActivityRunner.java:175)
    at com.vmware.vcloud.activity.executors.ActivityRunner.run(ActivityRunner.java:112)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
    Causedby:(vim.fault.DuplicateName)
    faultCause=null,
    faultMessage=null,
    name=<VM name>,
    object=ManagedObjectReference:type=VirtualMachine,value=vm-<moref>,serverGuid=null

Environment

VMware Cloud Director 10.x

Cause

This issue occurs when there is a virtual machine in vCenter Server with the same name as the named disk in Cloud director.

Resolution

To resolve the issue, remove the virtual machine from the vCenter inventory and then attach the named disk again in Cloud Director.

  1. Login to vCenter Server.
  2. Locate the named disk in the inventory.
  3. Click on the named disk VM object and then navigate to its Summary tab. Record the datastore location of the disk.
  4. Right click the named disk VM object and select the "Remove From Inventory" option.

    Please refer Remove and Reregister VMs and VM Templates or Add or Register a Virtual Machine (VM) in vCenter Server on how to remove and re-register the VM in vCenter.

  5. Login to the Cloud Direct Tenant UI. 
  6. Attach the Named Disk to a Virtual Machine as outlined in Attach or Detach a VMware Cloud Director Named Disk to a Virtual Machine.

    The named disk should mount to the VM and also the named disk object will appear in the vCenter UI again.