Rename VM Folder and Files in ESXI Shell

I had to do this when there is no vmotion available – Tested in ESXi 6.5

 

enable SSH on your ESXi host

Use Putty or something similar to connect to the ESXi host

  1. Run the following commands (in italics)
  2. cd /vmfs/volumes/<datastore name> ie if the datastore containing the VM is named datastore1 then you would run cd /vmfs/volumes/datastore1
  3. Next run ls to check that the VM folder is there
  4. Rename the folder using mv <oldVMFoldername> <newVMFoldername>
  5. Change into the folder with cd <NewVMFoldername>
  6. Rename the nvram, vmsd, vmx and <VMname-xxxx.hlog> files by running mv again ie
  7. mv oldname.nvram newname.nvram
  8. mv oldname.vmsd newname.vmsd
  9. mv oldname.vmx newname.vmx
  10. mv oldname-1234.hlog newname-1234.hlog
  11. Rename the vmdk file with vmkfstools -E oldname.vmdk newname.vmdk
  12. Edit the vmx file with vi newname.vmx
  13. Change the references from oldname to newname within this file
  14. Register the VM with the ESXi server and it should power on ok

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

Best Buy Co, Inc.
Best Buy Co, Inc.
Best Buy Co, Inc.