Hi guys,
I'm trying to create new VM in vApp but I stuck here. The API I'm using is vcloud-java-sdk-1.0.jar.
Could you please show me a code snippet how to do this?
For now I'm doing it like this:
RecomposeVAppParamsType recomposeVAppParamsType = new RecomposeVAppParamsType();
List<CompositionItemParamType> items = recomposeVAppParamsType.getItem();
ReferenceType vappTemplateVMRef = new ReferenceType();
// ??? seems that new reference to new VM should be here. But how to create that VM
CompositionItemParamType compositionItemParamType = new CompositionItemParamType();
compositionItemParamType.setSource(vappTemplateVMRef);
items.add(compositionItemParamType);
ReferenceType vAppRef = Vdc.getVdcByReference(vcloudClient, vdcRef).getVappRefByName("vApp_Websrv");
Vapp.getVappByReference(vcloudClient, vAppRef).recomposeVapp(recomposeVAppParamsType);
A day before I was playing with Web Services SDK, which is quite easier to understand. I was able to create vApp and VMs in vSphere. Is it possible to import vSphere VMs to vCloud? Which API should I use for that?
Thanks,
Hi,
You cannot add a new empty vm into a vapp.
Instead you can add a vm from an already existing vapp, vapptemplate.
For importing vm from vsphere to vcloud.
Importing vsphere vm as vApp into vcloud. VMWVimserver -> importVmAsVApp()
Importing vsphere vm as vAppTemplate into vcloud. VMWVimserver -> importVmAsVAppTemplate()
Also refer to the ImportVmAsvAppTemplate.java sample which is part of the vcloudjavasdk bundle.
Regards,
Rajesh Kamal.
Hi Rajesh,
Does it mean that for creating VM in vCloud programmatically there are 3 options:
1) Use web services SDK to create VM in vSphere and import it as vApp template or vApp
2) Use OVF file
3) Use existing vApp (vApp template)
Thanks,
Yes.
Regards,
Rajesh Kamal.
I am out of the office on vacation from 05-25-2011 3pm to 06-01-2011.
Hi,
can you tell me how to install the web services SDK? and where? in which directory??