You can create a hierarchy of resource pools by calling the ResourcePool.CreateResourcePool method passing in a ResourceConfig method as an argument. The ResourceConfig.cpuAllocation and ResourceConfig.memoryAllocation properties point to a ResourceAllocationInfo object that allows you to specify the information.
■ reservation – Amount of CPU or memory that is guaranteed available to the resource pool. Reserved resources are not wasted if they are not used. If the utilization is less than the reservation, the resources can be utilized by other resource pools or running virtual machines.
■ expandableReservation – In a resource pool with an expandable reservation, the reservation on a resource pool can expand beyond the specified value, if the parent resource pool has unreserved resources. A non-expandable reservation is called a fixed reservation. See Understanding Expandable Reservation. This property is ignored for virtual machines.
■ limit – Upper limit for CPU or memory resources assigned to this resource pool. The virtual machine or resource pool does not exceed this limit, even if resources are available. This property is typically used to ensure consistent performance. Set this property to -1 to indicate no fixed upper limit on resource usage.
■ shares – Relative metric for allocating memory or processing capacity among multiple resource pools. The SharesInfo data object has two properties, level and shares, that allow you to specify resource allocation.
■ level – Choose high, low, or normal to map to a predetermined set of numeric values for shares. See the API Reference Guide for the numbers for CPU, memory, and disk shares. Set this property to custom to specify an explicit number of shares instead.
■ shares – Allows you to specify the number of shares you want to allocate to the resource pool. The allocation is divided evenly between resource pools with the same level.Calling the ResourcePool.UpdateConfig or ResourcePool.UpdateChildResourceConfiguration method allows you to change the configuration.Assume the following scenario (shown in Admission Control with Expandable Resource Pools, Scenario 1):
■ You create a child resource pool RP-KID with a reservation of 2GHz and with Expandable Reservation selected.Now, consider another scenario with VM-M1 and VM-M2, shown in Admission Control with Expandable Resource Pools, Scenario 2.The ResourcePool.DestroyChildren method recursively deletes all the child resource pools of a resource pool. The operation takes a single parameter, a reference to the parent ResourcePool managed object. Any virtual machines associated with the child resource pool are reassigned to the parent resource pool.The ResourcePool.MoveIntoResourcePool method lets you move virtual machines, virtual applications, or resource pool hierarchies into a new resource pool. You call the method with an array of ResourcePool or VirtualMachine managed object references that you want to move. The whole resource pool hierarchy, including child resource pools and virtual machines, is moved when you move a resource pool.