Quantcast
Viewing all articles
Browse latest Browse all 2039

.NET SDK: Setting VM Hardware During vApp Compose Problems

I want to set CPU, Hardware, Memory and Hard Disk values for a child VM during vApp composition.  If someone can tell me how to do this, that would be great.

 

As another way of achieving what I need, I tried to do the compose, then get the child VM to update the CPU afterwards, but no children VMs are found.  I am using the following code:

 

           ...

           Vapp vapp = vdc.ComposeVapp(CreateComposeParams(vappTemplateRef, vdc, vappName));           
           
            List<Task> tasks = vapp.Tasks;
            if (tasks.Count > 0)
                tasks[0].WaitForTask(0);
            List<VM> vms = vapp.GetChildrenVms();
           
            foreach (VM vm in vms)
            {
                VirtualCpu vc = vm.GetCpu();
                vc.SetNoOfCpus(4);
                vm.UpdateCpu(vc);
            }

           ...

 

It does create the vApp properly and then the task is waited to complete, but then GetChildrenVms() method does not find any children.


Viewing all articles
Browse latest Browse all 2039

Trending Articles