Latest posts by Mohammed Raffic (see all)
- What's new in content libraries in vSphere 7 - Wed, Mar 25 2020
- Ansible for VMware infrastructure automation - Wed, Dec 25 2019
- Copy VMware VMs between ESXi hosts using the OVF Tool - Wed, Nov 13 2019
Since VMware vSphere 5.1, VMware has added a lot of features to simplify VM migrations. We can now migrate virtual machines between ESXi hosts, even if they don't have the shared datastores in between. Cross vCenter vMotion, released with vSphere 6.0, makes the VM migrations even simpler when migrating the workloads across vCenter servers.
This migration is possible when you have a vCenter server and both source and target ESXi hosts are managed by the vCenter Server. Similarly, copying a VM or a VM template between ESXi hosts is very simple when you have the vCenter server—you can simply clone the VM to the target ESXi host or even deploy a VM from VM templates wherever you want in the vCenter server. But what if you don't have a vCenter server but only standalone ESXi hosts? How can you move or copy VMs between ESXi hosts when you have standalone ESXi hosts that are not managed by vCenter servers?
In the case of standalone ESXi hosts, you could copy VMs between ESXi hosts by leveraging some of the tools, like VMware Converter, or you could even export the virtual machine to the jump host Windows system and then import the same into the destination host, but all this would take a while and you are dependent on a middle-man system for the VMware Converter installation or during import and export.
Another option is the OVF Tool. Open Virtualization Format (OVF) is an industry standard for describing metadata about virtual machine images in XML format. The VMware OVF Tool is available for many platforms, including Windows, Linux, and MAC OSX. The OVF Tool provides a lot of features, such as importing and exporting OVFs, converting between any VMware-supported format (VMX, OVF, OVA, vCloud Director, etc.), signing OVF packages, and validating OVF package signatures—and many more. In this article, we will look at how to copy VMware VMs directly between ESXi hosts using the OVF Tool.
Install the OVF Tool in Windows ^
As already discussed, the OVF Tool can be installed on various operating system platforms, such as Windows, Linux, and MAC OSX. For this demo, I will explain how to install the OVF Tool on a Windows platform. Installation is as simple as installing an app on a mobile phone; like all .msi package installations in Windows, just follow the installation wizard by clicking on Next.
Download the OVF Tool for Windows based on your operating system platform—whether it is a 32-bit or 64-bit platform—from the VMware website. In my case, the Windows operating system is 64-bit, and I have downloaded the OVF Tool .msi file.
Double-click on the downloaded .msi file to start the installation. In the Welcome to VMware OVF Tool setup wizard, click Next to start the installation and accept the license agreement.
The default installation location will be "c:\program files\VMWare\VMware OVF Tool". Click Next to continue the installation with the default location. If you want to specify a different installation location than the default, click on Change to modify it. Click Next to start the installation.
Copy VMs between ESXi hosts with the OVF Tool ^
To use the OVF Tool in Windows, open the Windows command line. The default installation location will be "c:\program files\VMWare\VMware OVF Tool". Change the directory in the Windows command line to the OVF Tool installation directory.
In this example, I have two ESXi hosts, called "md-esxi-i02" and "md-esxi-i07". Of the two hosts, "md-esxi-02" is the standalone host and the other, "md-esxi-i07", is part of one of my vSAN clusters. In this case, I want to copy the VM from my standalone host to the host managed by the vCenter Server. This will be the same as copying the VMs between two standalone ESXi hosts. Before copying the VMs between the ESXi hosts, let's query the list of virtual machines running on the source ESXi host, using the OVF Tool.
We have two virtual machines, "md-lab-vc01" and "Demo-VM", running on the source ESXi host "md-esxi-i02".
Of the two virtual machines in the source ESXi host, I want to copy the VM "Demo-VM" between the source host "md-esxi-i02" and the target ESXi host "md-esxi-i07" using the OVF Tool.
ovftool.exe -ds=<dest-datastorename> vi://<source-esxi-host-name/vm-name> vi://<destination-esxi-hostname>
It will prompt for the username and password to connect to the source and target ESXi hosts. Specify the username "root", and the password is your ESXi host root password. Once the password has been entered, it will start copying the VM from the source ESXi host to the target ESXi host. Once the copying is completed, the OVF Tool will report the status as "Transfer Completed".
Copying of the VM "Demo-VM" from the source to the target ESXi host is complete. Let's query the target host to validate that the VM "Demo-VM" is listed under the available virtual machines in the target ESXi host "md-esxi-i07". I can see the VM "Demo-VM" listed in the virtual machine list in the target ESXi host.
That's it. We have copied the virtual machine directly between the ESXi hosts using the OVF Tool. The Windows system that is running the OVF Tool will act only as a proxy between the source and destination ESXi hosts. Since no data will be stored in the Windows system with the OVF Tool installed, we don't need to worry about the storage capacity on the Windows system. We only need to have enough storage capacity on the destination ESXi datastore. The OVF Tool simplifies copying of a VM between ESXi hosts without the need for any additional software.