5 Replies Latest reply on Aug 2, 2017 11:33 AM by LucD

    Change VM Name and harddisk path directory and vmdk to reflect new VM name

    aatef6 Novice

      Hello Experts,


      I'm in the process of preparing a script to change some VMs names. I prepared the script and applied it on PowerCli to change VM names on the fly (VMs were powered on). However,  when i was checking the VM files (get-harddisk), i noticed that the VM files are still keeping the old VM names and it did not reflect the new VM name. I have performed a little bit of a research and i did find a few remedies for that but they all require the VM to be down.


      so my first question, is there a way to change the VM name and its files names on the fly while the VM is powered on? If the change cannot be done on the fly and VMs must be powered off what is the easiest and cleanest way to do it?


      I could see two possible solutions for it, one of them is to change the VM name and then try cold migration of the VM to another data store or another host and then move it back to the original host and this should trigger the VM to change its file names to reflect the new name. the second possible solution is to follow the steps of Renaming virtual machine files in-place using the console in this link (Renaming a virtual machine and its files in VMware ESXi and ESX (1029513) | VMware KB ). Your help is always appreciated. Thanks