We help IT Professionals succeed at work.

How to rename VM Folder

Hitesh
Hitesh asked
on
Hi, I have VM with three RDM attached to it. VM is stored in Datastore as "New Virtual Machine" which is not as per the corporate standard. I would like to rename this folder to the "VM name". Can you please suggest the solution.
Comment
Watch Question

Exchange server admin
Commented:
1.Shutdown the VM
2.Rename the VM in VirtualCenter
3.Migrate the VM and move it to another Datastore
4.done!
And from the service console:

1.vmware-cmd -s unregister /vmfs/volumes/datastore/vm/vmold.vmx
2.mv /vmfs/volumes/datastore/vm-old /vmfs/volumes/datastore/vm-new
3.cd /vmfs/volumes/datastore/vm-new
4.vmkfstools -E vm-old.vmdk vm-new.vmdk
5.find . -name ‘*.vmx*’ -print -exec sed -e ‘s/vm-old/vm-new/g’ {} \;
6.mv vm-old.vmx vm-new.vmx
for every file that hasn’t been renamed (.vmsd etc.)
7.vmware-cmd -s register /vmfs/volumes/datastore/vm-new/vm-new.vmx
8.done!
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017
Commented:
Easiest method is if you have Storage vMotion, if you Storage vMotion the VM from the existing datastore to another datastore, it will re-create all the files as the same as the name in the inventory.
HiteshSystem Engineer

Author

Commented:
I don't think so we can do storage vMotion with RDM attached to it.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
You will have to do it manually then.
HiteshSystem Engineer

Author

Commented:
How do I do it manually?  Would appreciate if you could list down the steps.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
they were listed in the first post...
Actually I believe you can use Storage vMotion with a RDM. I will not move the data of course but it will update the VMDK pointer file