Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 178257

VApp Instantiation

$
0
0

Hi All,

 

        I am using .net sdk for vcloud and i am using samples provided for .net sdk. There is no option specified about how to add NetworkConfigSectionType to InstantiationParamsType. Could someone help me in this issue?

 

 

 

                NetworkConfigurationType networkConfigurationType = new NetworkConfigurationType();
                if (vdc.GetAvailableNetworkRefs().Count == 0)
                {
                    Console.WriteLine("No Networks in vdc to instantiate the vapp");
                }
                networkConfigurationType.ParentNetwork = vdc.GetAvailableNetworkRefs().FirstOrDefault();
                networkConfigurationType.FenceMode = FenceModeValuesType.bridged;
                VAppNetworkConfigurationType vAppNetworkConfigurationType = new VAppNetworkConfigurationType();
                vAppNetworkConfigurationType.Configuration = networkConfigurationType;
                if (vdc.GetAvailableNetworkRefs() != null && vdc.GetAvailableNetworkRefs().Count > 0)
                {
                    vAppNetworkConfigurationType.networkName = vdc.GetAvailableNetworkRefs().FirstOrDefault().name;
                }
                List<VAppNetworkConfigurationType> vAppNetworkConfigs = new List<VAppNetworkConfigurationType>();
                vAppNetworkConfigs.Add(vAppNetworkConfigurationType);
                NetworkConfigSectionType networkConfigSectionType = new NetworkConfigSectionType();
                Msg_Type networkInfo = new Msg_Type();
                networkConfigSectionType.Info = networkInfo;
                networkConfigSectionType.NetworkConfig = vAppNetworkConfigs.ToArray();
//HerenetworkConfigSectionType is not attached to any of the item
                InstantiationParamsType instantiationParamsType = new InstantiationParamsType();
                InstantiateVAppTemplateParamsType instVappTemplParamsType = new InstantiateVAppTemplateParamsType();
                instVappTemplParamsType.name = "HellovCloudvAppp";
                instVappTemplParamsType.Source = vAppTemplateReference;
                instVappTemplParamsType.InstantiationParams = instantiationParamsType;
                             
                Vapp vapp = vdc.InstantiateVappTemplate(instVappTemplParamsType);

 

 

 

Kamal


Viewing all articles
Browse latest Browse all 178257

Trending Articles