VMware {code} Community
derekp
Contributor
Contributor

ColdMigration.java can't handle files larger than 2G

Hi,

I am trying to transfer VMs to VSphere. When using the sampe ColdMigration.java in the VSphere 4 Web Services SDK in Java I get the following message:

Putting VM File https://192.168.2.136/folder/RedHat5.4Cold/RedHat5.4-flat.vmdk?dcPath=ha-datacenter&dsName=Storage2

Files of size more than 2 GB are not supported

I suppose this caused by using a 32-bit size value in HTTP or somewhere else in the supporting code.

Is there any workaround for this or any other sample code or API that can, in a robust manner, transfer an abitrary VM to VSphere from my local disk? Maybe there is some OVF API I have just missed.

Derek

0 Kudos
6 Replies
paul_xtravirt
Expert
Expert

Derek,

Is the VM itself and OVF? If it is and you are coding for a vsphere environment, then you can use the OVFManager API to import the VM. I have done this in vb.net, unfortuantely, I dont have any Java code on this.

If you found this helpful, please consider awarding points

If you found this helpful, please consider awarding some points
0 Kudos
wodge
Enthusiast
Enthusiast

Hi Paul,

Could you please provide the .net code sample for this? I'll award some points then!

Many Thanks,

Warren

0 Kudos
admin
Immortal
Immortal

The OVFManager APIs are quite hard to deal with.

We do have a program we call the "Project Onyx" that will generate scripts based on your mouse click interactions with the vSphere Client. A sort of "macro recorder" if you will. You'd have to take the output and translate it into Java or C# or whatever but that part is pretty mechanical and straightforward. If you want to try it out check out the intro video.

=====

Carter Shanklin

Read the PowerCLI Blog
[Follow me on Twitter|http://twitter.com/cshanklin]

0 Kudos
derekp
Contributor
Contributor

Thanks everyone for your help.Sorry for my delayed answer. I don't seem to be getting emails for these messages.

However, the most effective solution for me was to use VIJava which has sample and WORKING code for importing and exported OVFs. It uses OVF manager (which is straigtforward to use compared to the file interfaces).

http://vijava.sourceforge.net/

Derek

0 Kudos
admin
Immortal
Immortal

Nice, didn't realize that. Let's all hope that Steve starts posting on the forums again.

=====

Carter Shanklin

Read the PowerCLI Blog
[Follow me on Twitter|http://twitter.com/cshanklin]

0 Kudos
rkamal
VMware Employee
VMware Employee

Attached the vmotion sample in c#.

0 Kudos