VMware’s OVFTool is a useful Windows command line utility that allows for direct upload and download of OVF/OVA images to and from vCloud Orgs, among other OVF/OVA manipulation operations.
OVFTool is available for free here (you may need to create a VMware account): https://code.vmware.com/tool/ovf/4.3.0
To start using the tool, download from the link above and install it. Then open Command Prompt (WIN+R, type “cmd”, then enter), and use the “cd” command to navigate to the install directory.
Uploading to vCloud
Uploading an OVF image to vCloud is a quick and easy way to start using Green Cloud’s IaaS with your own custom images.
Uploading to a vDC
Use the following syntax to upload a VM Image directly into a vDC, where it will appear in a vApp and will be ready for configuration:
- ovftool -tt=vCloud c:\<LOCAL_FILEPATH>\<FILE_NAME>.ovf “vcloud://<ORG_USER>@<VCLOUD_URL>/cloud?org=<ORG_NAME>&vdc=<VDC_NAME>&vapp=<VAPP_NAME>”
Replace the following:
- <LOCAL_FILEPATH> with the absolute file path containing the OVF Image
- <FILE_NAME> with the name of the OVF Image
- <ORG_USER> with the username that you use to log in to vCloud
- OVFTool will prompt you for the matching password
- <VCLOUD_URL> with the URL that you use to log in to vCloud
- Only use the domain name here, e.g. “vcd2.grncld.com”
- <ORG_NAME> with the full name of your vCloud Org
- <VDC_NAME> with the full name of your vCloud vDC
- <VAPP_NAME> with the desired name of the destination vApp (you can change this later)
Uploading to a Catalog
Alternately, rather than uploading directly to a vApp, you can use OVFTool to upload the image to a vCloud Catalog so that new VMs can be created using the image as a template. To go to the Catalog instead of the vDC, use the following syntax:
- ovftool -tt=vCloud c:\<LOCAL_FILEPATH>\<FILE_NAME>.ovf “vcloud://<ORG_USER>@<VCLOUD_URL>/cloud?org=<ORG_NAME>&vdc=<VDC_NAME>&vappTemplate=<VAPP_NAME>&catalog=<CATALOG_NAME>”
Replace each field as detailed above, with the following changes:
- <VAPP_NAME> with the desired name of the OVF Image in the Catalog
- <CATALOG_NAME> with the full name of the vCloud Catalog that will contain the image
Downloading from a Catalog
Use the following syntax to download a VM Image from an existing vCloud Catalog. Note that in order to export a running VM, you will need to first convert it into an OVF image as detailed here.
- ovftool vcloud://<ORG_USER>@<VCLOUD_URL>/cloud?org=<ORG_NAME>&vdc=<VDC_NAME>&vappTemplate=<VAPP_NAME>&catalog=<CATALOG_NAME> c:\<DESIRED_LOCAL_FILEPATH> -X:vCloudTimeout=86400 -X:vCloudKeepAliveTimeout=1440
Replace the following:
- <ORG_USER> with the username that you use to log in to vCloud
- OVFTool will prompt you for the matching password
- <VCLOUD_URL> with the URL that you use to log in to vCloud
- Only use the domain name here, e.g. “vcd2.grncld.com”
- <ORG_NAME> with the full name of your vCloud Org
- <VDC_NAME> with the full name of your vCloud vDC
- <VAPP_NAME> with the full name of the OVF Image in the Catalog
- <CATALOG_NAME> with the full name of the vCloud Catalog that contains the image
- <DESIRED_LOCAL_FILEPATH> with the desired local filepath to the new image
Other OVFtool Functions
Logging
In order to troubleshoot issues or timing with OVF Tool, use the following command switches to enable logging for your command:
- -X:logtoconsole
- -X:loglevel=verbose
- -X:logfile=log.log
VMDK to OVF Conversion
OVFtool can also be used to convert a VMDK image into an OVF image. Note that a VMX file is required to properly convert. Use the following command to perform the conversion:
- ovftool C:\Images\FileServ.VMX C:\Conversion\Output.OVF
This will place an OVF image at the specified output location.