Stranded VMs of vApp remain after deleting VMs with named disks
search cancel

Stranded VMs of vApp remain after deleting VMs with named disks

book

Article ID: 342534

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Symptoms:

  • After a user tries to delete VMs to which named disks are attached in vApp, these VMs remains in vSphere inventory and as stranded items.
  • Cannot manipulate (Delete and Detach) named disks after deleting these VMs
  • When an administrator tries to delete VMs from stranded items, this deletion is failed due to 'Failed to delete object "<VM NAME>" and its dependencies. - Failed to purge object "<VM NAME>". - Internal Server Error - Internal Server Error'.
  • When trying to delete VM's we get error " the requested operation could not be executed on vApp "DSC-xx.xx.". Stop the vApp and try again.
  • You can see logs similar to

 

2023-04-14 03:45:10,695 | ERROR  | storage-fabric-activity-pool-36 | FutureUtil           | Cannot detach disk | requestId=cf856630-aa99-402d-8e70-2d3917406215,request=DELETE https://vcd.tanzu.lab/api/admin/extension/strandedItem/357c49a5-a3c2-4911-bf9c-8de6470c046d,requestTime=1681443909787,remoteAddress=192.168.110.10:56505,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/*+xml;version 38.0.0-alpha vcd=20252f96-d909-4cb2-92dd-97a695217ecf,task=4201a9a5-24c3-4515-b05f-58afde8d946c activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:4201a9a5-24c3-4515-b05f-58afde8d946c) activity=(com.vmware.vcloud.fabric.storage.storedVm.impl.DeleteStoredVmActivity,urn:uuid:ce1ff484-06eb-42a3-ba9d-e2f4a414a5e8)

java.lang.NullPointerException

    at com.vmware.vcloud.fabric.storage.disk.impl.DetachDiskActivity$CreateShellVmFolderIfNeeded.invoke(DetachDiskActivity.java:91)

    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)

 

Environment

VMware Cloud Director 10.x
VMware Cloud Director for Service Provider 10.x

Resolution

This issue is resolved in VMware Cloud Director 10.4.2, available at Broadcom Support Portal 


Workaround:
  1. Open "Edit Settings" for these stranded VMs from vSphere Client.
  2. Disconnect Hard disk linked to named disks by checking [x] button (Note: Don't check "Delete files from datastore")
  3. Click "OK" button
  4. Delete stranded items from vCloud Director Admin Portal

 

Note:

  • "Force Delete" option can delete stranded VMs from both vCloud Director and vSphere. However, this option delete all disks attached to these VMs. Thus, named disks must be disconnected from these VMs before delete forcely.
  • After deleting stranded items of virtual machine, you may not be able to delete named disk related to this issue. If this issue happens, you can resolve by attaching these named disks to temporary VMs and detaching named disks before delete named disk from vCloud Director Admin Portal. Then delete named disk from vCloud Director Admin Portal.