Hi,
If I clone a vApp without any customization, I can't configure the network afterwards, e.g.
$vappRefs = $sdkVdc->getVAppRefs($vappName);
$sdkVapp = $service->createSDKObj($vappRefs[0]);
$vmRefs = $sdkVapp->getContainedVmRefs();
$sdkVm = $service->createSDKObj($vmRefs[0]);
$netSection = new VMware_VCloud_API_NetworkConnectionSectionType();
$netSectionInfo = new VMware_VCloud_API_OVF_Msg_Type();
$netSectionInfo->set_valueOf("Specifies the available VM network connections");
$netSection->setInfo($netSectionInfo);
$netSection->setPrimaryNetworkConnectionIndex(0);
$netCon = new VMware_VCloud_API_NetworkConnectionType();
$netCon->set_network($orgVdcNetwork);
$netCon->set_needsCustomization(false);
$netCon->setNetworkConnectionIndex(0);
$netCon->setIpAddress(NULL);
$netCon->setExternalIpAddress(NULL);
$netCon->setIsConnected(true);
$netCon->setMACAddress(NULL);
$netCon->setIpAddressAllocationMode($IpAddressAllocationMode);
$netSection->addNetworkConnection($netCon);
$modifyNetwork = $sdkVm->modifyNetworkConnectionSettings($netSection);
The error in the vCD log is as follows: The VCD entity network "Network" does not exist.
However, the network does exist - it can be added to the VM using the GUI.
Thanks