VMware Cloud Director 10.4.x
VMware Cloud Director 10.6.x
The issue with the VMs in the stranded folder in vCenter occurs when VCD deletes a VM, but that VM is actually not deleted from VC/ESXi.
The VM is then discovered again in Organization VDC(OVDC) RP, but VCD does not know whom it belongs and puts it into stranded VM folder in VC.
In terms of multiple folders, VCD will only attempt to create the stranded items folder only if it cannot find it. The folder duplication can happen because the already existing stranded folder has a different name from the one VCD would use which can be a consequence of temporary issues syncing with VC during the process or VC-ESXi connectivity issues.
To verify if the VM(s) is/are seen in VCD, please follow the steps as below:
https://<vcenter_server_ip_address_or_fqdn>/uihttps://<vcenter_server_ip_address_or_fqdn>/ui/app/vm;nav=v/urn:vmomi:VirtualMachine:vm-#####:########-####-####-####-############/summaryvm-#####sudo -u postgres psql vcloud
select vm.name as vmname,vm.id as vmid,vm.moref as vmmoref,vmc.name as vapp,vmc.org_vdc_id as ovdcid,cvm.id as cvmid,cvm.deployment_status as cvmstatus,dvm.instance_id as dvmid,vinv.is_deleted as vcvmstatsfrom vm left join vapp_vm vvm on vvm.svm_id = vm.idleft join vm_container vmc on vmc.sg_id = vvm.vapp_idleft join computevm cvm on cvm.id = vvm.cvm_idleft join deployed_vm dvm on dvm.vm_id = vm.idleft join vm_inv vinv on vinv.moref =vm.morefwhere vm.moref = '<vm moref from Step 2.1>';