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.

Linux
Migrate WordPress site to another hosting service.

IntroductionThis article details the migration of WordPress site (exactly this site you are now on) from one service provider to Amazon Lightsail. There might be various reason to do that (mine is outlined below) but in general I hope to share the message that especially with WordPress, migration can be …

VMware
VMware Workstation and Fusion can be installed and use for free (even for the enterprise)

For a while now, the VMware Workstation (and Fusion for MacOS) can be used without any additional fee for Personal use. That was a great Broadcom news and nice gesture from that software vendor. Recently Broadcom announced that the software will be available for all, even the commercial sector. This …

Linux
Salt, VMware implementation – part 1, introduction

As every IT administrator knows, the infrastructure (meaning storages, compute, VMware virtualisation stack) is just a fundaments to run various operating systems (OS) and finally (containerized) application. Therefore, installation of (let’s call it) infrastructure in the datacenter (SDDC), in that sense is just the beginning of the adventure. No wonder, …