Resource Allocation
When you create a virtual machine, you always specify the resource pool that the virtual machine can draw resources from and optionally a host on which the virtual machine should run. You can access the resource pool as follows:
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.
Resource Pool Hierarchies
Resource pool hierarchies allow detailed control over which virtual machines are allowed how many resources.
For example, assume a standalone host has several virtual machines. The marketing department uses three of the virtual machines and the QA department uses two virtual machines. Because the QA department needs larger amounts of CPU and memory, the administrator creates one resource pool for each group. The administrator sets CPU Shares to High for the QA department pool and to Normal for the Marketing department pool so that the QA department users can run automated tests. The second resource pool with fewer CPU and memory resources is sufficient for the lighter load of the marketing staff. Whenever the QA department is not fully using its allocation, the marketing department can use the available resources.
Allocating Resources to Resource Pools
Resource Pool Management Guidelines
The following rules govern resource pool creation.
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.
Cluster Overview
vSphere supports grouping ESX/ESXi hosts that are managed by the same vCenter Server system into clusters. Clusters take advantage of features such as VMware DRS and VMware HA.
You can set up VMware DRS to automatically migrate virtual machines, or to display recommendations if resources are not used efficiently across the datacenter.
See Creating and Configuring Clusters and Managing DRS Clusters.