Tag Archives: OVFTool

Quick Fix: OVF package with compressed disks is currently not supported

A couple of weeks ago I ran into an issue stopping me from importing an OVA and today I came across another issue relating to the Web Client not able to import OVF packages with compressed disks.

There seems to be a lot of issues to do with OVF/A operations in vSphere 6.5 Update 1…in fact there are 187 mentioned of OVF and 95 mentions of OVA in the release notes. Searching through the release notes I found a specific entry relating to this issue that I came across and it’s work around.

Deploying an OVF template containing compressed file references might fail
When you deploy an OVF template containing compressed files references (typically compressed using gzip), the operation fails.

The following is an example of an OVF element in the OVF descriptor:
<References>
<File ovf:size="458" ovf:href="valid_disk.vmdk.gz" ovf:compression="gzip" ovf:id="file1"></File>
</References>

The workaround is to download OVFTool and run a simple command to convert the OVF or OVA template to one without the compressed file…which in effect its just a copy of the original.

Seems like a strange fix but it works!

References:

https://docs.vmware.com/en/VMware-vSphere/6.5/rn/vsphere-esxi-vcenter-server-65-release-notes.html

vCloud Director: vApp Download Broken after SP Upgrade

As those who have been using vCloud Director for a while…the ISO/OFV upload/download functionality can be frustrating to use at the best of times even though over the past few versions of vCD the experience has improved. Thats said there is a little black magic that needs to be performed to get the right browser/JAVA combination.

When upgrading from vCD 5.5.x to vCD SP 5.6.x (or the 8.0 Beta) there is a new set of configuration items that need to be set that are not that well documented in any of the online materials for vCD SP. The problem manifests when you try to download a vApp from the vCD UI.

If you where able to get this far (I’ve found IE10 Running in Admin Mode with the latest Client Integration Client works best) once you hit OK the window closes and nothing happens. There is no trigger to start the export and download process and you get no feedback from the UI that something has gone wrong.

After putting through a support ticket with GSS and also posting the problem in the vCloud Director 8.0 Beta Forums I got an email from John Hemming to look at the settings under System -> Administration -> Public Addresses. These settings are used when you place your Cells behind a NAT or Load Balancer combination…vCD uses that address to construct the organization URL that organization users access to log in to the system. This is true to API calls:

During the initial configuration of each cloud cell, you specified an HTTP service IP address. By default, vCloud Director uses that address in the XML responses from the REST API and as the upload target for the transfer service (for uploading vApp templates and media). To use a different address, specify a public REST API base URL

During the upgrade process the Public URL and Console Proxy URL’s are copied across ok, but in all my instances the REST API base URL’s where left blank. In addition to that there is a new section to upload the SSL Chain (X.590 Format).

Once the details had been filled out relevant to the vCD Instance being configured and the SSL Certificate uploaded you should see a screen similar to this.

Once these settings have been applied you will get the familiar Upload/Download Status Bar and your download should complete without issue.

References:

http://pubs.vmware.com/vcd-56/index.jsp?topic=%2Fcom.vmware.vcloud.admin.doc_56%2FGUID-49B395C9-6E3A-49E9-9B65-FF69574A7D6C.html

OVFTool: vCloud Director vApp Export PowerShell Script

Last week I had a requirement to look at how to allow customers to export VM’s and vApps from our vCloud Director Zones without using the UI. I’ve known about the OVFTool for a while but never really had the need to use it in anger…for those that don’t know the OVFTool is a command line tool that has a powerful set of functions to import/export VMs and vApps from vCenter, ESXi and vCloud Director weather it be from a vCloud Air or vCloud Air Network Provider.

You can Download and install the tool from here: https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL410&productId=491

Upon doing some research I found a bunch of posts relating to importing OVFs into vCloud Director, vCloud Air or vCenter’s but not a lot around the export side of things…after working through the Admin Guide and some examples I was ready to build out a basic export command and start work on the PowerShell Script. On Windows you can run the tool from CMD but I would suggest using PowerShell/CLI as in the example below I go through building a variable.

What Info is Required:

  • vCloud URL
  • vCloud Username and Password
  • Org Name
  • vDC Name
  • vApp Name

Note: The VM/vApp needs to be offline for the export process to take place.

Command Line Example:

Below is a basic example of how to construct the vCloud String and use it as a variable to execute the tool.

PowerShell Script:

Wanting to take it a step further to make it easier for our customers to download their vApps I put together a quick and nasty PowerShell Script that can be used for all ZettaGrid Zones. The output of the script can be seen below:

It’s a very basic script that acts to break down the required components that make up the vCloud Source Connection String and then saves the OVF to the same folder where the OVFTool is installed.

Save the code snippet as a .ps1 into the OFVTool Windows Folder and execute the script from the same location. If there are any errors with the inputs provided the OVFTool will fail with an error, but apart from that it’s a very simple straight forward way to export and download VMs and vApps from any vCloud Director enabled endpoint.

Behind the Scenes:

I thought it would be interesting to see what happens behind the scenes on the vCloud Director Cells when the OVFTool is brought in do it’s magic….When the OVFTool Authenticates against vCloud the following entries are seen in the cell.log of the active vCenter Proxy Cell.

When the Enable Download task is executed the cell begins to copy the vApp to the Cell Transfer directory which is the staging area vCloud Director uses for all VM/vApp related copy/move/import/export functions…During this copy the OVFTool displays the Waiting for Server Task status. If you where able to view the contents of the director created in the transfer location you would see the vmdk growing in size as shown below:

If you check into the vCloud Director UI and browse to the vApp you will see that the vApp is Busy with a status of Enabling Download.

Once the copy has finished the OFVTool starts the download and once that is complete (or there is an error) the files in the vCloud Director Transfer area are deleted. In my testing I haven’t witnessed any continuation or pick off where it last failed mechanism.

Feel free to take the script and do with it what you will…it can be pretty easily modified to connect to any vCloud Air Network Partner or vCloud Air its self.

Additional Reading:

http://www.virtuallyghetto.com/tag/ovftool

http://www.vmwarebits.com/content/import-and-export-virtual-machines-command-line-vmwares-ovf-tool