4 Replies Latest reply on Mar 31, 2015 6:00 AM by onappdev

    How to connect vApp network to VM's nic at the "instantiation from a template" step?

    onappdev Novice

      Hey guys,

      I'm stuck with the situation where I'm not able to connect vApp network to VM's nic at the step of vApp instantiation from a template.

      I've read this docs VMware vCloud Director 5.6 Documentation Center and tried using the construction:

      <?xml version="1.0" encoding="UTF-8"?>
      <InstantiateVAppTemplateParams
         xmlns="http://www.vmware.com/vcloud/v1.5"
         name="111"
         deploy="true"
         powerOn="false"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
         <Description>vApp with the new network</Description>
         <InstantiationParams>
            <NetworkConfigSection>
               <ovf:Info>Configuration parameters for logical networks</ovf:Info>
               <NetworkConfig networkName="net1>
                  <Configuration>
                     <ParentNetwork href="https://example.com/api/network/e4627307-8ab9-46c3-8ae9-b6f31158f665" />
                     <FenceMode>bridged</FenceMode>
                  </Configuration>
               </NetworkConfig>
            </NetworkConfigSection>
         </InstantiationParams>
         <Source href="https://example.com/api/vAppTemplate/vappTemplate-db2d4ba6-7f36-44be-a2de-50ddff8a3985" />
         <SourcedItem>
            <Source href="https://example.com/api/vAppTemplate/vm-28bfdffa-a75e-4921-9de1-6a3c4fdb8af6"/>
            <VmGeneralParams>
               <Name>111VM</Name>
               <Description>VM with the new network</Description>
               <NeedsCustomization>true</NeedsCustomization>
            </VmGeneralParams>
            <InstantiationParams>
                <NetworkConnectionSection 
                     type="application/vnd.vmware.vcloud.networkConnectionSection+xml"
                     xmlns="http://www.vmware.com/vcloud/v1.5"
                     xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
                     <ovf:Info>Firewall allows access to this address.</ovf:Info>
                     <PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
                     <NetworkConnection network="net1">
                          <NetworkConnectionIndex>0</NetworkConnectionIndex>
                          <IsConnected>true</IsConnected>
                          <MACAddress>00:50:56:01:01:49</MACAddress>
                          <IpAddressAllocationMode>POOL</IpAddressAllocationMode>
                     </NetworkConnection>
                </NetworkConnectionSection>
            </InstantiationParams>
         </SourcedItem>
         <AllEULAsAccepted>true</AllEULAsAccepted>
      </InstantiateVAppTemplateParams>
      

       

      But vCloud Director 5.6 responds with the 400 error:

      Unsupported instantiation section: {http://www.vmware.com/vcloud/v1.5}NetworkConnectionSection
      

       

      However VMware docs says that InstantiationParamsType does have such a section "NetworkConnectionSection".

      It's also possible in existing vCD UI wizard to instantiate vApp from a template and to connect its network to a children VM's nic.

      Furthermore, when I try using the same xml syntax for recomposeVApp/reconfigureVM actions the vCD accepts it as valid and connects the network to the VM.

      So is it possible with API to connect a vApp network to a VM's nic at the instantiation step or do I have to do that after the instantiation of the vApp is finished?

       

      Thanks!