Unregistered VM and unable to locate VM files to register again.
search cancel

Unregistered VM and unable to locate VM files to register again.

book

Article ID: 371429

calendar_today

Updated On:

Products

VMware vSphere ESXi 8.0 VMware vSphere ESXi 7.0 VMware vCenter Server 7.0 VMware vCenter Server 8.0

Issue/Introduction

Removed VM from VC inventory or unregistered VM from ESXi host before confirming the VM folder and file location and names.

Environment

ESXi 7.0

ESXi 8.0

vCenter 7.0

vCenter 8.0

Cause

VM folder and file names do not match current VM display name (label) in vSphere client inventory.

Resolution

Use the below steps to find the VM "displayName" (label) value within the VM's vmx file matching the last known display name seen in vSphere inventory.

  • Connect to a ESXi host via SSH that has access to the datastore(s) the VM is known to be last stored on.

  • Navigate to "/vmfs/volumes/<datastore_name>".

  • Within each datastore directory run command “find -iname \*.vmx” to retrieve list of vmx files and their locations.

  • Review vmx file with “cat <vm_name>.vmx | less”. Find value for “displayName = “<vm_name_you_are_looking_for>”.

    • NOTE: You may also be able to use grep commands to search for the specific display name (label) within each of the vmx files.
      • Example: find -iname \*.vmx | grep -i "test-vm-2" (this should display list of vmx files containing the VM name specified).

 

Once the VM is registered again within VC inventory, perform a Storage vMotion to a different datastore or clone the VM to force the VM folder and file names to be updated to match the current VM display name. You can Storage vMotion the VM back to the original datastore once complete if necessary.