■ Standalone host – When you call Folder.AddStandaloneHost_Task, the call returns a Task object that contains the ComputeResource. The ComputeResource.resourcePool property is the root resource pool associated with the compute resource (and with the host).
■ Cluster – When you call Folder.CreateClusterEx, the method returns a managed object reference to a ClusterComputeResource instance. Because ClusterComputeResource inherits all properties of ComputeResource, you can access the root folder through the ClusterComputeResource.resourcePool property.
■ Before creating new child resource pools, check available resources in the parent pool. The ResourcePool.runtimeInfo property is a ResourcePoolRuntimeInfo data object. ResourcePoolRuntimeInfo.cpu and ResourcePoolRuntimeInfo.memory properties are ResourcePoolResourceUsage objects with resource usage information, including an unreservedForPool property. If the parent resource pool does not have enough available resources, reconfigure the reservation values of child pools before adding the new pool.