Use the find-orphan-vms command of the cell management tool to find references to virtual machines that are present in the vCenter database but not in the vCloud Director database.

Virtual machines that are referenced in the vCenter database but not in the vCloud Director database are considered orphan VMs because vCloud Director cannot access them even though they may be consuming compute and storage resources. This kind of reference mismatch can arise for a number of reasons, including high-volume workloads, database errors, and administrative actions. The find-orphan-vms command enables an administrator to list these VMs so that they can be removed or re-imported into vCloud Director. His command has provisions for specifying an alternate trust store, which might be needed if you are working with vCloud Director or vCenter installations that use self-signed certificates.

Use a command with the following form:

cell-management-tool find-orphan-vms options

Table 1. Cell Management Tool Options and Arguments, find-orphan-vms Subcommand

Option

Argument

Description

--help (-h)

None

Provides a summary of available commands in this category.

--enableVerifyHostname

None

Enable the host name verification part of the SSL handshake.

--host

Required

IP address or fully-qualified domain name of the vCloud Director installation to search for orphan VMs.

--output-file

path name or -

Full path name of the file to which the list of orphan VMs should be written. Specify a path name of - to write the list to the standard output.

--password (-p)

Required

vCloud Director system administrator password.

--port

vCloud Director HTTPS port.

Specify this only if you do not want this command to use the default vCloud Director HTTPS port.

--trustStore

Full path name to a Java trust store file.

Specify this only if you do not want this command to use the default vCloud Director trust store file.

--trustStorePassword

Password to specified --trustStore

Required only if you use --trustStore to specify an alternate trust store file.

--trustStoreType

The type of the specified --trustStore (PKCS12, JCEKS, ...)

Required only if you use --trustStore to specify an alternate trust store file.

--user (-u)

Required

vCloud Director system administrator user name.

--vc-name

Required

Name of vCenter to search for orphan VMs.

--vc-password

Required

vCenter administrator password.

--vc-user

Required

vCenter administrator user name.

Finding Orphaned VMs

This example queries a single vCenter server. Because --output-file is specified as -, results are returned on the standard output.

[root@cell1 /opt/vmware/vcloud–director/bin]# ./cell-management-tool find-orphan-vms \
 --host 10.20.30.40 -u vcadmin -vc-name vcenter1 -vc-password P@55w0rd --vc-user admin --output-file -
Querying for VC by name 10.20.30.40
Querying all vdc's associated with VC: 10.20.30.40 (https://10.20.30.40:443)
Querying all vdc<->resource pool mappings associated with VC: 10.20.30.40 (https://10.20.30.40:443)
Querying all vdc<->VM Moref mappings associated with VC: 10.20.30.40 (https://10.20.30.40:443)
Processing 956 VM's on 5 VDC's across 20 resource pools
Analysis complete.
VDC: "ExampleOrgVDC [urn:vcloud:vdc:1a97...]" (org: "ExampleOrg") ResPool: primary (1a97...) [moref: "resgroup-30515"]
The following 22 orphan VMs were discovered:
Orphan VM: "indDisk100-0-95411 (cbc358a0-e199-4024-8fff-2e5cfce20953)" (parent name: "Test VMs", parent moref : "group-v30533")
...
Orphan VM: "indDisk12-0-51259 (0bbb4115-673e-4c84-ba26-6875159655e0)" (parent name: "Test VMs", parent moref : "group-v30533")