vSphere – 10 ways to Migrate a Virtual Machine

This guide is written for those who need all methods of migrating, cloning, cross vMotion, and just moving a VM period. Please use your best judgement as this is a list of other options when options A, B, and C doesn’t work. Hopefully this blog post will save the day for many folks out there, as most of the time 90% of your VMs should migrate without a problem. This list is for the remaining 10% that just won’t move even after following all the requirements.

 

Disclaimer: For educational purpose only, use your best judgment and test it with a test machine before you actually do it in production!

 

Prerequisites Links

  1. For Cross vCenter Migration and Cloning in vSphere 6.0 https://kb.vmware.com/s/article/2106952
  2. Long Distance vMotion requirements https://kb.vmware.com/s/article/2106949

 

Useful Links

  1. Great blog post on vMotion deep dive https://vmarena.com/vmware-vmotion-vsphere-6-5/
  2. Upgrade, Migrating best practices https://sivasankar.org/2018/1288/upgrading-migrating-from-vsphere-5-x-to-6-x-best-practices/
  3. How to vMotion between different VDS switches https://www.virtuallyghetto.com/2018/09/vmotion-across-different-vds-version-between-onprem-and-vmc.html

The Obvious Choices

  1. Migrate a VM using vMotion
    • If there is shared storage, all you need to do is change compute resource only
    • If there is no shared storage, you will need to select Change both compute resource and storage. This method is more time consuming as it will copy the entire VM contents over to the new datastore


  2. Clone the VM to the new environment
    • Just clone the VM to the new environment. Power off the original VM and then power on the cloned one.


 

 

The other methods when all else doesn’t work

Below are methods when all else fails. Once again, I will need to put in a disclaimer

Disclaimer: For educational purpose only, use your best judgment and test it with a test machine before you actually do it in production!

    1. Disconnect the Host and reconnect it to the new environment
    2. Use Cross vCenter Workload Migration Utility Fling

 

  1. Use your backup software to do a full backup of the VM and restore it to the new destination
    • Why not leverage what you already pay for. If you don’t have a backup solution, now is a time to try out some free trials
    • Safe method as the original VM is still intact

  2. Use shared Datastore to migrate VMs over to the new environment
    • Basically, you need to work with your storage guy to span the storage so that both sites can see it.
    • If you can get all the new and old host on the same cluster you can do a simple and quick vMotion
    • If they are on separate clusters, you will need to power off the VM. Remove the VM from inventory (DO NOT DELETE THE VM). Browse for the VMX file in the datastore and re-add it to inventory in the new environment.
    • Tips: make sure you know what the name of the VM folder is in the datastore. Sometimes the VM name and the folder name inside the datastore are different.
  3. Export the VM to OVF Template from the original destination and reimport it back in to the new destination
    • The VM has to be turned Off but exporting it to a local machine or a jump box is a very safe method as it doesn’t affect the original VM. However, the process is time consuming.
    • Using the vSphere Client, look for the Export OVF Template

  4. Use VMware HCX
  5. Use vSphere Replication or Fault Tolerance
    • Both of these are free and they are similar to the cloning method however these methods give you a lot more flexibility.
    • Fault Tolerance is an active/active clone of your VM, therefore you can make the switch anytime you need to without losing a second of data.
    • vSphere Replication will continuously sync the changes you make to your primary VM to the powered off clone. Buying you time to switch when over at a later time.
  6. Copy the entire VM Folder in the Datastore
    • This is the longest method by far and can be done when exporting to OVF doesn’t work. Basically, all you do is Browse for the Datastore where the VM is in and then copy the VM folder. Then upload it back to another datastore and register the VMX file.

If you have other methods, please share your comments below. Also comment if you have found this helpful.

twitterpinterestlinkedinmail