In the last couple of months, I have noticed an increase in customer interests in using the Cross vCenter vMotion (xVC-vMotion) capability that was introduced back in vSphere 6.0. In my opinion, I still think this is probably one of the coolest features of that release. There is no longer the limitation of restricting your Virtual Machine mobility from within a single vCenter Server, but you can now live migrate a running VM across different vCenter Servers.
The primary method to start a xVC-vMotion is by using the vSphere Web Client which requires your vCenter Servers Servers to be part of the same SSO Domain and will automatically enable the new Enhanced Linked Mode (ELM) feature. ELM allows you to easily manage and view all of your vCenter Servers from within the vSphere Web Client as shown in the example screenshot below.
However, the vSphere Web Client is not the only way to start a xVC-vMotion, you can also automate it through the use of the vSphere API. In fact, there is even an "Extended" capability of xVC-vMotion that is not very well known which I have written about here which allows to live migrate a running VM across two different vCenter Servers that are NOT part of the same SSO Domain. This Extended xVC-vMotion (unofficially I am calling it ExVC-vMotion) is only available when using the vSphere API as the vSphere Web Client is unable to display vCenter Servers that are part of another SSO Domain. Below is a quick diagram to help illustrate the point in which VM1 can be seamlessly migrated between different vCenter Servers from within the same SSO Domain as well as between different vCenter Servers that are not part of the same SSO Domain.
UPDATE (06/15/17) - I have added a few minor enhancements to the script to support migrating a VM given a vSphere Resource Pool which enables the ability to migrate to and from VMware's upcoming VMware Cloud on AWS (VMC). There is also an additional UppercaseUUID parameter which seems to be required for some xVC-vMotions where the vCenter Server's InstanceUUID must be provided as all upper case or the operation will fail. I have still not identified why this is needed for some migrations, but for now there is a nice flag that can be used to enable this if you are hitting this problem.
UPDATE (04/08/17) - In vSphere 6.0 Update 2, there is a known limitation which prevents a VM that has multiple VMDKs stored across different datastores to be xVC-vMotion (compute only) using the vSphere Web Client. This limitation no longer exists in vSphere 6.0 Update 3 but does require customers to upgrade. If you need to perform a compute-only xVC-vMotion where the VM has multiple VMDKs across different datastores, the vSphere APIs does not have this limitation and you do not necessary need to upgrade to be able to perform this operation. Huge thanks to Askar Kopayev who discovered this and also submitted an enhancement to my xMove-VM PowerCLI script to support this functionality.
Given the amount of interest recently and some of the feedback on my original ExVC-vMotion script which I had written about here, I figured it was time to refactor my code so that it could easily support both ExVC-vMotion as well as standard xVC-vMotion. In addition, I have also added support for migrating to and from a Distributed Virtual Switch (VDS), where as previously the example only supported Virtual Standard Switch (VSS). Lastly, the script now also supports migrating a VM that is configured with multiple vNICs.
The new script is now called xMove-VM.ps1 and is even more simpler than my original script. You will need to edit the script and update the following variables:
|vmname||Name of the VM to migrate|
|sourceVC||The hostname or IP Address of the source vCenter Server in which the VM currently resides in|
|sourceVCUsername||Username to the Source vCenter Server|
|sourceVCPassword||Password to the Source vCenter Server|
|destVC||The hostname or IP Address of the Destination vCenter Server in which to migrate the VM to|
|destVCUsername||Username to the Destination vCenter Server|
|destVCpassword||Password to the Destination vCenter server|
|datastore||Name of the vSphere Datastore to migrate the VM to|
|cluster||Name of the vSphere Cluster to migrate the VM to|
|resourcepool||Name of the vSphere Resource Pool to migrate the VM to|
|vmhost||Name of the ESXi host to migrate the VM to|
|vmnetworks||Name of the vSphere Network(s). in the order in of the vNIC interfaces to migrate the VM to|
|switch||Name of the vSphere Switch to migrate the VM to that is comma separated and ordered by vNIC|
|switchtype||The type of vSphere Switch (vss or vds)|
|xvctype||Whether this is a Compute-only Cross VC-vMotion (1=true or 0 = false)|
|UppercaseUUID||There cases where the vCenter Server InstanceUUID must be all caps ($true or $false)|
Here is a screenshot of running the script:
Note: When changing the type of vSphere Switch, the following combinations will are supported by the script as well as using the vSphere Web Client: VDS to VDS, VSS to VSS and VSS to VDS. VDS to VSS is not supported using the UI or API and neither are 3rd party switches supported.
Here are some additional xVC-vMotion and vMotion articles that may also useful to be aware of:
- Are Affinity/Anti-Affinity rules preserved during Cross vCenter vMotion (xVC-vMotion)?
- Duplicate MAC Address concerns with xVC-vMotion in vSphere 6.0
- Auditing vMotion Migrations