Unable to manage UNKNOWN VM in VMware Cloud Director
search cancel

Unable to manage UNKNOWN VM in VMware Cloud Director

book

Article ID: 371530

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Unable to remove vApps in VCD, VM(s) are in an UNKNOWN state.
  • VMs already deleted in vCenter Server, cannot remove from Cloud Director.
  • An import of a VM from vCenter failed, now the VMs cannot be removed from Cloud Director.

Environment

VMware Cloud Director 10.4.x

VMware Cloud Director 10.5.x

Cause

This issue will occur when Cloud Director cannot verify the state of the VM in vCenter.

  • This often occurs when the VMs were deleted directly in vCenter.
  • It can also occur when an import fails and the corresponding entries do not exist in the database to allow Cloud Director to properly query vCenter.

Resolution

  1. Locate the Primary Cell and connect to the database
    1. sudo -i -u postgres psql vcloud
  2. Depending on the scenario, run one of the below queries, if unsure run both and capture the output.
    1. Ensure to replace <VM Name> with the name of the VM as it appears in Cloud Director/vCenter.
    2. In vCenter, do not use the appended ID or UUID in the query.

Scenario 1: VM was deleted in vCenter and/or has existed and been previously managed in Cloud Director 

select 
org.name as Tenant,
vdc.name as VDC,
vmc.name as vApp,
vapp_vm.name as VM,
cvm.deployment_status as CVM,
dvm.date_deployed as deployed
from vapp_vm
left join vm on vm.id = vapp_vm.svm_id
left join vm_inv on vm_inv.moref = vm.moref
left join computevm cvm on cvm.id = vapp_vm.cvm_id
left join deployed_vm dvm on dvm.vm_id = vm.id
left join networked_vm nvm on nvm.id = vapp_vm.nvm_id
left join vm_container vmc on vmc.sg_id = vapp_vm.vapp_id
left join org_prov_vdc vdc on vmc.org_vdc_id = vdc.id
left join organization org on org.org_id = vdc.org_id
where vapp_vm.name like '<VM Name>%'
order by org.name;


Scenario 2: VM exists in vCenter, cannot be imported into Cloud Director

select 
org.name as Tenant,
vdc.name as VDC,
vmc.name as vApp,
vapp_vm.name as VM,
cvm.deployment_status as CVM,
dvm.date_deployed as deployed
from vm_inv
left join vm on vm.moref = vm_inv.moref
left join vapp_vm vapp_vm on vapp_vm.svm_id = vm.id
left join computevm cvm on cvm.id = vapp_vm.cvm_id
left join deployed_vm dvm on dvm.vm_id = vm.id
left join networked_vm nvm on nvm.id = vapp_vm.nvm_id
left join vm_container vmc on vmc.sg_id = vapp_vm.vapp_id
left join org_prov_vdc vdc on vmc.org_vdc_id = vdc.id
left join organization org on org.org_id = vdc.org_id
where vapp_vm.name like '<VM Name>%'
order by org.name;

Open a Case with Broadcom Support and upload the output of the above queries.