Hi,
I am using the following high-level workflow:
1. New VMware_VCloud_API_InstantiateVAppTemplateParamsType
2. New VMware_VCloud_API_NetworkConnectionSectionType
3. New VMware_VCloud_API_NetworkConnectionType
4. Add NetworkConnectionType to NetworkConnectionSectionType
5. New GVMware_VCloud_API_GuestCustomizationSectionType
6. New VMware_VCloud_API_InstantiationParamsType
7. setSection to InstantiationParamsType: NetworkConnectionSection & GuestCustomizationSection
8. Instantiate vApp
The setSection lines cause an error:
POST https://[vcloud-url]/api/vdc/bc68aea6-0fd5-474b-967c-938ca7238168/action/instantiateVAppTemplate failed, return code: 400, error: <?xml version="1.0" encoding="UTF-8"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="BAD_REQUEST" message="Unsupported instantiation section: GuestCustomizationSection" majorErrorCode="400" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5http://vcloud.cloudhelix.net/api/v1.5/schema/master.xsd"></Error>
, request data:
If these are commented out, the vApp is deployed, but obviously without any network configuration or guest customization. Do you have any suggestions?
Code in more detail:
// New InstantiateVAppTemplateParamsType object
$vappTemplateParams = new VMware_VCloud_API_InstantiateVAppTemplateParamsType();
$vappTemplateParams->set_name($vappName);
$vappTemplateParams->setDescription($vappDesc);
$vappTemplateParams->set_deploy(false);
$vappTemplateParams->set_powerOn(false);
$vappTemplateParams->setSource($vAppTemplateRef);
// New NetworkConnectionSectionType object
$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);
// New NetworkConnectionType object
$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);
// Add NetworkConnectionType to NetworkConnectionSectionType
$netSection->addNetworkConnection($netCon);
// New GuestCustomizationSectionType
$guestSection = new VMware_VCloud_API_GuestCustomizationSectionType();
$guestSectionInfo = new VMware_VCloud_API_OVF_Msg_Type();
$guestSectionInfo->set_valueOf("Specifies Guest OS Customization Settings");
$guestSection->setInfo($guestSectionInfo);
$guestSection->setComputerName($vmName);
// New InstantiationParamsType object
$vappParams = new VMware_VCloud_API_InstantiationParamsType();
$vappParams->setSection(array($netSection));
$vappParams->setSection(array($guestSection));
$vappTemplateParams->setInstantiationParams($vappParams);
// Instantiate vApp
$newVapp = $sdkVdc->instantiateVAppTemplate($vappTemplateParams);