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.

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.

Accessing and Identifying VM Files on ESXi Host via SSH

  1. Establish SSH connection:
    • Connect to the ESXi host using SSH. Ensure you have the necessary credentials and network access.
  2. Navigate to datastore directory:
    • Use the cd command to navigate to the datastore directory where the VM is believed to be stored: cd /vmfs/volumes/<datastore_name>
    • Replace <datastore_name> with the actual name of the datastore.
  1. Locate VM configuration files:
    • Execute the following command to list all .vmx files within the datastore directory: find . -iname "*.vmx"
  2. Identify Target VM configuration file:

              Method 1: visual inspection

    • Use the cat and less commands to review the contents of each .vmx file: cat <vmx_filename> | less 
    • Search for the displayName parameter and its corresponding value to identify the desired VM.

              Method 2: grep search

    • Use the grep command to filter .vmx files based on the VM's display name: find . -iname "*.vmx" | xargs grep -i "<VM_DISPLAY_NAME>"
       
    • Replace <VM_DISPLAY_NAME> with the exact display name of the VM you're searching for.

 

Once the VM is registered again within VC inventory, perform a Storage vMotion to a different data store 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 data store once complete if necessary.