Packer: vsphere/iso: Export ovf "Wrong file size specified in OVF descriptor"

Created on 3 Apr 2020  ยท  5Comments  ยท  Source: hashicorp/packer

Overview of the Issue

Using the new feature to export OVF. The calculation of the disk size when the ovf is created seems to be wrong. This works correctly. However, when using ovftool to convert to an ova, the following warning occurs:

Opening OVF source: /.../output-vmware-ovf/windows_server_2019.ovf
The manifest validates
Opening OVA target: /.../windows_server_2019.ova
Writing OVA package: /.../windows_server_2019.ova
Transfer Completed
Warning:
 - Wrong file size specified in OVF descriptor for 'windows_server_2019-disk-0.vmdk' (specified: 42949672960, actual 3961170432).
Completed successful

Packer version

Packer v1.5.5

Operating system and Environment details

OSX 10.14.6 (18G87)

bug buildevsphere track-internal

Most helpful comment

I got the same message and the OVF exported by vsphere-iso currently seems unusable.

After #9020 was released as a part of Packer 1.5.6 I tried the following:

  • deploying the exported OVF to two vCenter servers using the vsphere post-processor

  • converting the OVF to OVA manually using ovftool and uploading it to vCloud Director

All of these attempts have the same result - I get a VM which seemingly looks fine (in terms of virtual hardware, disk size etc) but has virtual disks which are zero in size:

image

and doesn't boot.

Message I get from ovftool when converting to OVA:

Wrong file size specified in OVF descriptor for 'centos7-XXX-disk-0.vmdk' (specified: 12884901888, actual 1344942592).
Wrong file size specified in OVF descriptor for 'centos7-XXX-disk-1.vmdk' (specified: 12884901888, actual 74752).

Virtual disk 0 is 10 GB and disk 1 is 2 GB in size if that's of any help.

Packer 1.5.6
ovftool 4.3.0 (build-13981069)
vSphere 6.5

All 5 comments

I got the same message and the OVF exported by vsphere-iso currently seems unusable.

After #9020 was released as a part of Packer 1.5.6 I tried the following:

  • deploying the exported OVF to two vCenter servers using the vsphere post-processor

  • converting the OVF to OVA manually using ovftool and uploading it to vCloud Director

All of these attempts have the same result - I get a VM which seemingly looks fine (in terms of virtual hardware, disk size etc) but has virtual disks which are zero in size:

image

and doesn't boot.

Message I get from ovftool when converting to OVA:

Wrong file size specified in OVF descriptor for 'centos7-XXX-disk-0.vmdk' (specified: 12884901888, actual 1344942592).
Wrong file size specified in OVF descriptor for 'centos7-XXX-disk-1.vmdk' (specified: 12884901888, actual 74752).

Virtual disk 0 is 10 GB and disk 1 is 2 GB in size if that's of any help.

Packer 1.5.6
ovftool 4.3.0 (build-13981069)
vSphere 6.5

Hi @nilic thanks for updating the issue. The fix in PR #9020 was more of a fix for the issue where the post-processor was not able to find the exported OVF file. This is a related but different issue that we need to look into. I don't have a timeline for the fix, but we will take a look into this issue once we get a chance.

I've been working on this and I figured out that when I export the OFV directly from the vSphere Client and also using govc the descriptor will have a different size from the actual file size causing the warning message when using ovftool to convert to OVA. I'm writing a solution that will fix the size in the description to avoid this warning.

I'll later try to understand the case of @nilic. It seems to me that this is another possible issue different from the one that is being reported here. Do you mind opening a new issue for this?

@sylviamoss opened #9629

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings