Cross vCenter VM Mobility – CLI – Another cool fling

0

VMware Flings team released the Cross vCenter Mobility Tool yesterday. Cross vCenter VM Mobility -- CLI is a command line interface (CLI) tool that can be used to migrate or clone a VM from one host to another host managed by a linked or isolated vCenter (VC) instance.

Up until vSohere 6.0, the migration or cloning of one VM from vCenter to another vCenter was only possible when the vCenter Servers were in linked mode. And this can be still be done using the vSphere Web Client.

If the vCenter Servers were not linked to each other, there was no way that the administrator knew what was the inventory objects on the other isolated vCenter Server instance.

Hence, this tool will help those administrators where there is an odd requirement on moving VMs from isolated vCenter Server instance to another.

Head over to the Flings website here and download the zip file and extract it on the local machine. We will get back to this in awhile.

Before we go test this out in a lab, let us first look at the requirements:

  • JDK 1.7 or above
  • Two vCenter instances with ESX 6.0 (linked or isolated)
  • Windows: Windows Server 2003 or above
  • Linux: RHEL 7.x or above, Ubuntu 11.04 or above

Let us see what parameters are available with this Cross vCenter Mobility Tool:

-op : operation -- <required> {relocate, clone}
-svc : source vCenter IP/DNS Name/URL -- <required>
-su : source vc username -- <required>
-dvc : destination vCenter IP/DNS Name/URL -- <required>
-du : destination vCenter Username -- <required>
-vms : one or more VM names separated by a comma -- <required>
-cln : clone VM name -- [required for clone operation] -dcl : destination DRS cluster -- [required when destination host is not given] -dh : destination host -- [required when dest DRS-cluster is not given] -dds : destination datastore -- [optional but required for multiple VMs to relocate] -swt : destination switch type -- [optional {vss / vds}] -dnw : destination network switch name -- [required when switch type is given]

Now that we have an understanding of how we can use this tool using the parameters, let us set up the Windows machine to be able to use this tool successfully.

We will first have to set JAVA_HOME (preferably jdk1.7 or above ) system variable.  To perform this, go to Advanced System Settings > Environment Variables.

  • In System variables, add a new JAVA_HOME variable and point it to the JDK installed folder.
  • In System variables, find PATH, clicks edit and append this %JAVA_HOME%\bin to the end.

The below command is for the migration of one VM from one vCenter Server to another.

 .\xvc-mobility.bat -svc 192.168.1.202 -su [email protected] -dvc 192.168.1.201 -du [email protected] -vms TinyLinuxVM -dh 192.168.1.11 -dds iSCSI-1 -op relocate

Once you try to run this command, you will receive certificate warnings for both the vCenter Servers, just say yes to them.

Cross vCenter VM Mobility - CLI - Another cool fling

The below command cam be used to clone the VM from one vCenter Server instance to another.

.\xvc-mobility.bat -svc 192.168.1.201 -su [email protected] -dvc 192.168.1.202 -du [email protected] -vms TinyLinuxVM -cln TinyLinuxVM-clone -dh 192.168.1.15 -dds iSCSI-2 -op clone

Cross vCenter VM Mobility - CLI - Another cool fling

I hope this has been informative and thank you for reading!

Share.

About Author

I am Adil Arif, working as a Technical Support Engineer at VMware as well as an independent blogger and founder of Enterprise Daddy. In my current role, I am supporting infrastructure related to Windows and VMware datacenters.

Leave A Reply

LIKE WHAT YOU'VE READ?
If so, please join the community.  I’d love to send you exclusive content right to your email, and I’ll send you a free copy of my book, VMware vSphere 6.0 Lab on Workstation too!
Enter your name and email below, and I’ll see you on the inside!

SUBSCRIBE