Using the vRO action for vCloud named addVAppVM (code shown below) as a model
var recomposeVAppParams = new VclRecomposeVAppParams();
var vmItem = new VclSourcedCompositionItemParam();
if (vmName != null) vm.name = vmName;
vmItem.source = vm.getReference();
vmItem.sourceDelete = false;
vmItem.instantiationParams = new VclInstantiationParams();
var numNetConnections = vm.getNetworkConnectionSection().networkConnection.size();
if (numNetConnections > 0) {
var networkConnectionSection = new VclNetworkConnectionSection();
networkConnectionSection.info = System.getModule("com.vmware.library.vCloud.common").createOvfMsg(null,"NetworkConnectionSection");
for (netIx = 0; netIx < numNetConnections; netIx++) {
var netCon = new VclNetworkConnection();
netCon.networkConnectionIndex = netIx;
netCon.network = "none";
netCon.ipAddressAllocationMode = VclIpAddressAllocationModeType.NONE;
netCon.isConnected = false;
networkConnectionSection.networkConnection.add(netCon);
}
vmItem.instantiationParams.section.add(networkConnectionSection);
}
recomposeVAppParams.sourcedItem.add(vmItem);
return vApp.recompose(recomposeVAppParams);
I was able to create an action that configures the network, Guest Customization, General Parameters and the storage Policy.
I have also added the VirtualHardwareSection, but where as the above sections are updated the Virtual Hardware is now. the od part is that while the vApp is recomposing the VM shows the desired "storage" but as soon as the recompose complets the "storage" drops back to the value in the template.
If anyone has any ideas on what i'm missing I would appreciate hearing them