If you have an occasion to export large amounts of VM’s to OVA’s like I currently do, you may find the following useful for creating a script to do just that. Cheers!
Download OVF Tool
Download OVF Tool installer from the following link:
Browse to OVF Tool
Locate OVF Tool tool from the command line. For me on Mac (using Fusion):
/Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool
For Windows, it should be:
C:Program FilesVMwareVMware OVF Tool
I will break down the arguments individually, since this won’t be exactly the same for you. Here’s the full command I used in my lab:
./ovftool --noSSLVerify vi://email@example.com/vCenter ~/Desktop/vCenter.ova
This is the tool. On Windows, you might need to include .exe or something. I don’t have any of that garbage to test this on 😉
If you’re wiser than me, you might want to leave this flag out. I just put it in so that I wouldn’t have to type ‘yes’ to accept the SSL cert thumbprint.
This is the path specific to ESXi/vCenter. If you were trying to export a Workstation VM, you could just as easily use
C: for instance.
This works out to be
[username]@[host or VC]. You could also include a password if you’re scripting and don’t care if it’s in clear text.
This is the path to your VM. There’s a number of different ways to use this tool, including pointing at a datastore, searching using queries, etc. If the VM is in a resource pool or folder, you’ll need to specify, but if the VM is in the root resource pool of the host like mine, you can just type the name.
This is the filename on the machine I’m running the OVF Tool on. Name your output file here.
Here’s a screenshot of what a successful export looks like.
If you have any trouble with the export, you can run the command with the following flag to generate a log file to help with troubleshooting:
Also, for more detailed usage on OVF Tool, check out the best two resources I know of, VMware and VMware’s own William Lam.