Did you know?
That if you change the name of a virtual machine while is powered on; the files that consist for that VM will not be changed. This would mean that vCenter would display a different name that would be found in the file system level. To resolve this while the VM is running it is recommended that you:
- Change the name.
- Use VMotion to move the machine to a new datastore (This will rename the files that are copied).
- VMotion back.
This will avoid confusion and having to shut down the VM for any scheduled downtime. On the flipside, you can do it the proper way:
- Make sure there is no snapshots etc.
- Shutdown the virtual machine.
- If you are using VirtualCenter, remove the virtual machine from the inventory but do not delete the files from disk.
- Connect to the ESX Server host on which the virtual machine resides over SSH.
- Unregister the virtual machine using command: vmware-cmd -s unregister <path to config file>
- Where <path to config file> is the path to the configuration file as determined by ‘vmware-cmd –l’ . ‘/vmfs/volumes/storage1/vm1/vm1.vmx’
- Rename the folder, .vmx file, and .vmdk (+ flat) file to match the new name.
- Edit the vmx file to reflect the name of the new descriptor file.
- Locate the scsi0:0.fileName line.
- Save the file and exit
- Edit the .vmdk file to reflect the name of the new flat file.
- Locate the Extent description section of the .vmdk file.
- Register the virtual machine.
- Add the virtual machine back into VirtualCenter inventory using the Virtual Infrastructure Client by browsing the data store, finding the .vmx file, right-clicking and adding it to inventory.
For more details.