Migrate virtual system between vCenter with VM name changing.

  1. Check if you have a reliable backup of VM.
  2. Check VM configuration, primarily vmx file location, disks, controller and portgroups where the system is connected to. This step is important, in any case something goes wrong, so do not ignore it!
    Also it could be worth to check if you can login to the system.
  3. Unregister VM from vCenter inventory (right clicking on the system -> unregister).
    Pay attention, delete is very close to unregister option. Be careful 😉
  4. SSH to ESXi. Change the directory to where the system_name.vmx file is. This should be something similar to the:
    cd /vmfs/volumes/DATASTORE/VM_name
  5. Create temporary directory for our backup and copy vmx file (and other you think may be important):
    mkdir temp
    cp *.vmx temp
  6. Delete all unnecessary files. In fact all you need is *.vmx and *vmdk files. Pay attention, each VM disk consists of two files (name.vmdk and name-flat.vmdk). If you are unsure if you need some file, you can move it to the temp directory instead of deleting it.
  7. For each disk change it name using the following command:
    vmkfstools -E old_name.vmdk new_name.vmdk
    Note, if some of the disks are placed in non-default VM location, you will have to change the directory and replace this step.
  8.  Change all references in vmx file to the new one:
    sed -i ‘s/old_name/new_name/g’ FILE.vmx
  9. Migrate (copy if possible) VM to new vCenter and register it.
  10. Delete VM from the old location.

Of course as usual there is more than one way to do this.
Above algorithm is my preferred way but you will have to find what the best works for you.
For those who prefer of using WebUI. You could use storage vMotion to change VM name, but only if you have enough space to proceed with that. Additionally vmx file cannot be fully edited through vCenter WebUI, but you can download it to local workstation, edit and upload it again. Just don’t forget to uregister system from primary vCenter anyway.

No Comments

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Free(BSD)
Search for duplicated files

This will be short (but hopefully I will find more time to show entire process to search duplicated files together with some examples). In case you are searching for duplicated files I can recommend two software which actually rocks in openSource world

Azure
NFS issue, cannot be mounted or is not visible

The same kind of issue I have encountered numerous times while working across different environments and with various customers. The problem with NFS mounts connected from remote locations is so common. This issue extends beyond communication solely over WAN and also include connections between datacenters (DC) where we lack control …

Azure
Why Firefox is important and people should use this browser in 2024, my thoughts.

Can you remember the times when everyone was using Internet Explorer? Back in the ’90s and the early part of this century, Internet Explorer dominated the browser market. Software Incompatibility with Other Browsers Incompatibility issues with software and other browsers have been a persistent problem. Even in 2022, this remains …