A root resource pool is associated with each ComputeResource and with each ClusterComputeResource.

You can create a hierarchy of resource pools by calling the ResourcePool.CreateResourcePool method and passing in a ResourceConfigSpec argument. The ResourceConfigSpec.cpuAllocation and ResourceConfigSpec.memoryAllocation properties point to ResourceAllocationInfo objects that allow you to specify the following information.

  • reservation – Amount of CPU or memory that is guaranteed available to virtual machines within 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 borrowed by virtual machines running within other resource pools.
  • 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 Reservations.
  • limit – Upper limit for CPU or memory resources assigned to this resource pool. The resource pool does not allocate more resources to its children, even if resources are available through its parent. This property is typically used to ensure consistent performance by isolating other resource pools from the effects of the running virtual machines within this pool. 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 in resource contention situations. The shares value indicates resource priority relative to the shares values of sibling resource pools or virtual machines. 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 a custom value for the number of shares you want to allocate to the resource pool. This property is ignored unless the level is set to custom.

To change the configuration, call the ResourcePool.UpdateConfig or ResourcePool.UpdateChildResourceConfiguration method and pass in a ResourceConfigSpec that contains values for all fields you want to update.