VMware Cloud Community
sfortuna74
Contributor
Contributor

VMDK file renaming: Looking for best practices

Hello -

Our organization has implemented a standard which requires us to set a specific name to each vmdk file which is created for every virtual machine. My first gues at the best manner to do this would be to browse a datastore and right-click and rename the vmdk file thru the VI Client gui interface. If someone could confirm that this is the best practice, or recommend what the actual best practice would be, I would appreciate it very much.

Thanks in advance,

Steve

0 Kudos
6 Replies
kooltechies
Expert
Expert

Hi,

VMware recomends for most of the administrative tasks which can ve done by VC/VI should be done by these applications only. However renaming a .vmdk can be achieved through the command line also. But you need to make sure that after renaming the .vmdk you will need to also make appropriate changes in the vm's .vmx file.

Thanks,

Samir

P.S : If you think that the answer is helpful please consider rewarding points.

Blog : http://thinkingloudoncloud.com || Twitter : @kooltechies || P.S : If you think that the answer is correct/helpful please consider rewarding points.
khughes
Virtuoso
Virtuoso

An easy way to rename your virtual machines is to rename the VM inside the VI Client and then doing a storage migration to a different LUN. When you do this it will rename all the files to the new name you set in the VI Client

  • Kyle

-- Kyle "RParker wrote: I guess I was wrong, everything CAN be virtualized "
0 Kudos
Texiwill
Leadership
Leadership

Hello,

Do not use special characters, characters that can be interpretted as commands by the GNU/Linux shells. Do not leave trailing spaces. Basically A to Z, a to z, 0 to 9, and - or _ are the best characters to use when naming VMs and VMDKs.


Best regards,
Edward L. Haletky
VMware Communities User Moderator, VMware vExpert 2009
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
sfortuna74
Contributor
Contributor

When I tried to rename the .vmdk file thru the VI Client, I received an error message stating "At the moment, VI Client does not support the renaming of virtual disks as the machines that use this disk may lose access to the disk". The reason we are doing this is that each virtual machine will have 3 volumes -so we want each .VMDK file to denote which drive letter it belongs to.

Thanks

0 Kudos
Texiwill
Leadership
Leadership

Hello,

That works. You can do this several ways but most likely you will need to do the rename through the CLI and then the fix up of the VM can either be a by hand edit of the VMX or use the VC to 'remove' the old named disk and then 'add' the newly named disk.

You can also use the datastore browser to download the VMDK, make hte change and upload the VMDK, but you must also fix the config to see the newly named VMDK.


Best regards,
Edward L. Haletky
VMware Communities User Moderator, VMware vExpert 2009
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
admin
Immortal
Immortal

To rename from the command line use vmkfstools -E oldname.vmdk newname.vmdk.

0 Kudos