Wednesday, April 6, 2011

Reloading a vmx file without removing the Virtual machine from inventory

If you manually edit a vmx file your changes are not recognized from vSphere. You must remove the virtual machine from inventory and then add it again manually for the changes to be recognized. But we can do something else to reload the vmx file without removing the virtual machine from inventory:
First we must connect to ESXi using ssh. From this shell we must enter this command to find the Inventory ID of the virtual machine:
vmware-vim-cmd vmsvc/getallvms | grep <virtual machine name>
The output of this command is the Inventory ID we want. So we can enter this command to reload the vmx file:
vmware-vim-cmd vmsvc/reload <inventory id>
For more information please take a look at this article from VMware's KB.

No comments:

Post a Comment