isekely
Contributor
Contributor

vCloud java SDK error - No file(s) to upload

Hi.

I'm trying to write simple code to deploy several VM's into vApp.

the flow (use case) is that:

get VDC ref

create vApp template on vdc

get catalog

create catalog item, the vApp template (and add it to the catalog)

upload OVF and VMDK to the vApp template

...

in the upload method, I'm getting exception of info:com.vmware.vcloud.sdk.VCloudException: No file(s) to upload

this is the method (VmDescriptor is just a Triple of [ovf location, vmdk location, vmdk file name]:

private void uploadVmDescriptorToVappTemplate(VmDescriptor vmDesc,

VappTemplate vappTemplate)

throws VCloudException,

FileNotFoundException, InterruptedException {

// uploading ovf file

File ovfFile =

new File(vmDesc.getFirst());

FileInputStream ovfFileInputStream =

new FileInputStream(ovfFile);

vappTemplate.uploadOVFFile(ovfFileInputStream, ovfFile.length());

vappTemplate = VappTemplate.getVappTemplateByReference(

vcloudClient,

vappTemplate.getReference());

while (!vappTemplate.getResource().isOvfDescriptorUploaded()) {

Thread.sleep(5000);

vappTemplate = VappTemplate.getVappTemplateByReference(

vcloudClient, vappTemplate.getReference());

}

// uploading vmdk

File vmdkFile = new File(vmDesc.getSecond());

FileInputStream vmdkFileInputStream = new FileInputStream(vmdkFile);

vappTemplate.uploadFile(vmdkFile.getName(), vmdkFileInputStream,

vmdkFile.length()); // throwing exception here

vappTemplate = VappTemplate.getVappTemplateByReference( vcloudClient, vappTemplate.getReference());

while (vappTemplate.getResource().getStatus() != 😎 {

Thread.sleep(5000);

vappTemplate = VappTemplate.getVappTemplateByReference(

vcloudClient, vappTemplate.getReference());

}

}

the path's are legal, I checked them few times.

also - attached the eclipse console output.

thanks,

Ido

0 Kudos
2 Replies
rkamal
VMware Employee
VMware Employee

Hi,

The OVF which you are trying to upload is not supported.

Your log file contained this information.

"The following error was encountered while validating the OVF file you provided: OVF XML validation failed:
OVF v0.9x is not supported"

http://www.vmware.com/pdf/vcd_10_api_guide.pdf - Pg No 43

This release of the vCloud API imposes the following restrictions on uploaded OVF content:
You can upload either OVF 1.0 or OVF 1.1 content. OVF 1.1 packages are converted to OVF 1.0 for
download, and any OVF 1.1 content is lost.

Regards,

Rajesh Kamal.

isekely
Contributor
Contributor

thanks for your quick reply!

is there any way of converting v0.9 to v1.0?

a brief view into ovftool guide gave me nothing.

0 Kudos