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.

VMware
VCF, backup configuration

Backup implementation for VMware component is fairly easy. Just the requirements is to configure SFTP server in proper way and make it network available to the VMware components. SDDC Manager and NSX Manager backup In VCF Operations it is possible to configure backup for SDDC Manager and NSX Manager. Go …

VMware
VCF Automation, fresh environment configuration with identity providers and access control.

Introduction Login Login as user admin to the Organization name: system or if selected manual: Check the connections (in Administration section), where you should see connection to the vCenter and NSX-t manager as those are provided automatically via VCF Operations: the same for VCF Instances: Also check your networking: Identity …

VMware
VCF SoS

SoS (Supportability and Serviceability) command can be used for troubleshooting purpose to generate VCF (per component) log bundle, massively enable/disable ssh service on ESXi, vCenter, password and certificates expiry status, verify cluster health and many other. while troubleshooting, the following commands can be helpful: