Quick rename of VM

By | April 11, 2008

Duncan over at YelloBricks.com posted a nice easy howto on renaming a VM from within VC and from the service console.

There are a couple of ways to rename a Virtual Machine, but there are two in my opinion that stand out:

  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


Leave a Reply

Your email address will not be published. Required fields are marked *