Renaming a virtual machine and its files in VMware ESXi

Source : https://kb.vmware.com/s/article/1029513?docid=2094957

Rename the virtual disk (VMDK) files using the vmkfstools -E command:

# vmkfstools -E "originalname.vmdk" "newname.vmdk"

Notes

  • In some cases, it may be required to clone (copy) a virtual disk. To clone a virtual disk to a new virtual disk, run this command:

    # vmkfstools -i "originalname.vmdk" "newname.vmdk"

    This leaves the original virtual disk untouched. You need enough space available to clone the virtual disk in the destination directory. In the preceding command, the new virtual disk is created in the current directory but a different directory can be specified.
     
  • You need not rename the originalname-flat.vmdk file after running the vmkfstools command. The vmkfstools command renames both VMDK files and updates the reference within the descriptor.
     
  • Do not use the cp or mv commands to rename virtual disk files. Instead, use VMware utilities such as vmkfstools.