Quantcast
Channel: VMware Communities : Discussion List - VMware vCloud SDK for Java
Viewing all articles
Browse latest Browse all 144

Add new hard disk while composing vApp.

$
0
0

Hi All,

 

Is it possible to add a new hard disk to the VM while composing a Vapp using a vappTemplate?

 

 

I have tried adding the VirtualHardwareSection in the InstantiationParams of the VM as below. I get the compose Vapp success, but the hard disk is not being added. It is completely ignoring the VirtualHardware Section I had specified.

 

InstantiationParamsType vmInstantiationParamsType = new InstantiationParamsType();
List<JAXBElement<? extends SectionType>> vmSections = vmInstantiationParamsType.getSection();
vmSections.add(new ObjectFactory().createNetworkConnectionSection(networkConnectionSectionType));
vmSections.add(new ObjectFactory().createGuestCustomizationSection(guestCustomizationSectionType) );
vmSections.add(new com.vmware.vcloud.api.rest.schema.ovf.ObjectFactory().createVirtualHardwareSection(addNewDisk("Hard Disk 2", "4096")));
vappTemplateItem.setInstantiationParams(vmInstantiationParamsType);               

 

 

Thanks,

Ramakrishna.


Viewing all articles
Browse latest Browse all 144

Trending Articles