UPDATE: If you’re using the odftool.exe and need to use domain accounts read my update here.
I manage a bunch of TFS servers that live on consumer grade hardware. This means that I have to be very good on backups and I also need to be on the lookout for better hardware. I recently purchased some more RAM for a machine that I have sitting around. It was hosting some development VMs; nothing that required a large amount of RAM. I did have a TFS build server that ended up having a bunch of CI builds pointed to it. I decided to do the good think and move the TFS VM to the newer machine with more RAM.
Unfortunately the VMWare vCenter Client that comes with the free license does not support copying from one host to another. I found a good article here that talks about how to do this with a tool called ovftool.
I had not used ovftool before and assumed it was something on the ESXi host that needed to be run from a SSH instance. It turns out you do not need to SSH into the ESXi host to use this tool. The tool is a windows console application that you run from your workstation.
There is another caveat with ovftool. It does not support certain special characters in your password. I had a bunch of special characters so I don’t know if it is any special character or if there are a set. I ended up creating a user called ovfuser with a password that was alphanumeric only. Doing this I was able to use the ovftool to transfer one VM to another host.
Here’s the breakdown of the call:
ovftool.exe -ds=[DATASTORE_NAME_ON_TARGET] vi://HOST/VMNAME vi://HOST2
HOST2 is going to be the ESXi host where your VM will be copied. From the best I can tell the ds argument is the datastore on the target VM which will contain the VM files.
Hopefully this will help you backup or migrate your VMs to other machines!