VMware Cloud Community
EricTrentMiller
Enthusiast
Enthusiast
Jump to solution

rename directory in datastore

see image below.

When I rename a VM in vCENTER, it doesn't rename the directories in the datastore for that VM.  There doesn't seem to be any way to do it in the datastore browser.

If I want my vm names to match the directory structure...do I have to recreate the vms from scratch and just rename/reuse the .vmdks?

untitled.JPG

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

That is expected, you can have the "displayName" be something different than the actual name of the files. If you want it to match, you have two choices:

1) Power off the VM and manually rename all the files, including the VMDK descriptor file

2) If you have vCenter & Storage vMotion, you can migrate the VM to a datastore in which it allows you to change the name and the files will all be updated baesd on the name you gave it

View solution in original post

0 Kudos
3 Replies
lamw
Community Manager
Community Manager
Jump to solution

That is expected, you can have the "displayName" be something different than the actual name of the files. If you want it to match, you have two choices:

1) Power off the VM and manually rename all the files, including the VMDK descriptor file

2) If you have vCenter & Storage vMotion, you can migrate the VM to a datastore in which it allows you to change the name and the files will all be updated baesd on the name you gave it

0 Kudos
GaneshNetworks
Jump to solution

Power the VM down.

Remove that inventory from VC.

Create one new vmx entry and add the existing vmdk file with the new vmx.

Power it on back.

But the thing is existing folder should be there. Don't delete it. By doing this, you can esaily step forward to troubleshoot the things in future, otherswise you will be suffered. Or follow LAMW steps.

It should be addressed by VMware. Until then, no other way to go.

Thanks,

Ganesh

~GaneshNetworks™~ If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
a_p_
Leadership
Leadership
Jump to solution

IMO you should - if licensed - go with lamw's option 2 (Storage vMotion). The folder and files will usually be automatically renamed to the VM's name in the inventory. If you want to have vCenter Server on your iSCSI-PRI-LUN0 you will have to run Storage vMotion a second time to move it back.

Definitely the faster way is option 1. Be careful with the renaming, you may have to quote the space character in the current files names. To rename the vmdk I would suggest you use "vmkfstools -E <old.vmdk> <new_vmdk>" ("-E" is case sensitive!) instead of editing the header file manually. If you go with this option, power off the VM and remove it from the inventory before you are going to rename the folder/files and edit the vmx file. Once done with renaming and editing add it back to the inventory.

André