There comes a time in every sysadmin’s life when a second Virtual Machine Center is added to the inventory of awesomeness and soon You’ll find yourself reevaluating your current setup from a load balancing poing of view.
Either way, moving around virtual machines within the same environment is for the most part a relatively painless process – even morese using VMware vCenter to manage your Hosts. However, for those of you who manage ESXi / vSphere without it, there exists a free and simple solution to copy your vm from host to host, without the need to store the vm image at a temporary location, such as an USB drive.
For this we’ll be using the VMware Open Virtualization Format Tool (ovftool), which you should download and install on your system before reading any further (as of writing 4.1.0 is the current version – but this should work in the future as well. If not, please let me know!)
- ESXi Host A [192.168.1.2]
- VM-Test virtual machine
- ESXi Host B [192.168.1.3]
- no virtual machines
- Download and install ovftool if you haven’t already
- Run it using the following parameters (first defining the destination datastore, then the source path followed by the destination path). Under Mac OS X it would look like this:
./ovftool -ds=datastoreB vi://firstname.lastname@example.org/VM-Test vi://email@example.com
- Hopefully you have at least password protected your hosts (if not for passkey auth) so you’ll be asked for those, after which just sit back and wait for the completion
You can also use the optional diskMode switch
-dm=thin to set the destination vm disk to thin, which can greatly reduce the transfer size (and thus the needed time) should you have a thick-provisioned source vm (or one with a lot of free space).
For more info, check the ovftool manual at VMware’s site!