Reloading a vmx file without removing the virtual machine from inventory
search cancel

Reloading a vmx file without removing the virtual machine from inventory

book

Article ID: 343248

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • Changes are not recognized in vCenter Server when you edit a virtual machine's .vmx file.
  • If you use the Remove from Inventory option to remove the virtual machine, you must re-add it manually with the datastore browser which generates a new Inventory ID.


Environment

VMware vSphere ESXi 6.7
VMware vSphere ESXi 6.0
VMware vSphere ESXi 6.5
VMware vSphere ESXi 5.0
VMware vSphere ESXi 5.5
VMware vSphere ESXi 5.1

Cause

The virtual machine's .vmx configuration file can be reloaded from the command line. This operation does not generate a new Inventory ID (Vmid) for the virtual machine and allows it to stay in the same resource pool.

Resolution

To resolve this issue, reload the virtual machine's .vmx configuration file.
Note: Configuration changes through .vmx file require the Virtual Machine to be Powered off.

To reload the virtual machine's .vmx configuration file, perform one of these options:
  • Reload the configuration file of all the virtual machines on the ESXi/ESX host using a script by running this command:

    for a in $(vim-cmd vmsvc/getallvms 2>&1 |grep invalid |awk '{print $4}'|cut -d \' -f2);do vim-cmd vmsvc/reload $a;done
     
  • Reload the .vmx configuration file from the command line:
  1. Log in to the Local Tech Support Mode console of the ESXi/ESX host. For more information, see:
     
  2. Obtain the Inventory ID (Vmid) for the virtual machine using this command:

    # vim-cmd vmsvc/getallvms

    Note: The output shows virtual machines which are registered on the ESXi/ESX host.

    You see output similar to:

    Vmid Name File Guest OS Version Annotation
    2848 Win2003_storage_performance [local] Win .vmx winNetEnterpriseGuest vmx-07 To be used as a template


    In this example, the Vmid is 2848.
     
  3. Reload the .vmx file using this command:

    # vim-cmd vmsvc/reload Vmid


Additional Information