6.8 vCPU Slots for VM Hosts

In the Orchestration Server, a vCPU represents a logical CPU. It provides a way to set up limits for allocating CPUs on VM hosts. These limits let you specify how many vCPUs should be hosted by each VM host so that you can control how much CPU processing power is available. If all vCPUs are in use, a subsequent provision can be denied or made to wait. This lets you ensure the quality of service you want to maintain in the data center.

When a VM is provisioned, the Orchestration Server runs a constraint check on every suitable VM host to determine if the number of available vCPUs on the VM host is sufficient for a VM. If a VM host with sufficient available vCPUs is not available, the provisioning request waits until one becomes available or (depending on VM facts) the request is denied.

Using vCPU facts differs from using the existing slot fact (vmhost.maxvmslots). The maxvmslots fact provides basic control of the number of VMs allocated to a VM host, which is useful for limiting VMs because of license restrictions or for generally limiting the VMs being managed. The vCPU facts are similar to the memory limit facts, giving you more control to avoid overloading a VM host and letting you ensure quality of service.

This section includes information about how the vCPU facts are used in the Orchestration Server.

6.8.1 Configuring vCPUs on VM Hosts

There are two vCPU facts displayed on the VM host Info page in the Orchestration Console:

  • Max Hosted vCPUs: This value (Integer) represents the maximum number of vCPUs that the VM host can support. The fact name is vmhost.vcpu.max.

  • Available vCPUs: This value (Integer) represents the number of virtual CPUs available on this host. The fact name is vmhost.vcpu.available.

The vmhost.vcpu.available value changes when a VM is provisioned or shut down on that VM host. If the vmhost.vcpu.max fact is set to -1 (unlimited), the vmhost.vcpu.available value changes to -1 (unlimited). When it is set to unlimited, no counting occurs, so the Orchestration Server does not check vCPU limits.

When a VM host object is created (during discovery), the vmhost.vcpu.max value is set to the number of physical cores multiplied by a factor of 4. For example, on a Xen VM host that has eight physical cores, the Orchestration VM host discovery for Xen creates a VM host object with a maximum vCPU of 32. The factor value of 4 represents partitioning a physical core to four vCPUs, which represents 25% capacity.

You can change this default value by creating a policy that sets the vmhost.vcpu.max fact value and associates the policy either to the VM host or to a Resource Group of VM hosts. In the preceding Xen VM host example, if you wanted to partition the eight physical cores on a VM host to 50% capacity, you would set the maximum vCPUs to 16 by creating the following policy and then associating it to the VM host or to a Resource Group of VM hosts:

<policy>
   <vmhost>
       <fact name="vcpu.max" type="Integer" value="16" />
  </vmhost>
</policy>

If you want the Orchestration Server to allocate vCPUs without checking limits, you can set the maximum vCPUs to -1, which indicates an unlimited number. You would create the following policy to make that configuration setting:

<policy>
   <vmhost>
       <fact name="vcpu.max" type="Integer" value="-1 />
  </vmhost>
</policy>

6.8.2 Configuring vCPUs on VM Host Clusters

Because the VM host Cluster object represents a set of VM hosts, both vmhost.vcpu.available and vmhost.vcpu.max facts are sums of the underlying VM host objects. If all of the underlying VM hosts have their vmhost.vcpu.max values set to -1 (unlimited), then the corresponding vmhost.vcpu.max fact in the VM host Cluster is -1 (unlimited). This also means that no counting or checking occur for vCPU limits. This is used in scenarios where you rely on the underlying hypervisor to account for vCPUs rather than the Orchestration Server. For example, if you have set up vSphere with DRS and clustering, you do not need the server to do any checking.

NOTE:The Orchestration Server vsphere provisioning adapter sets the vmhost.vcpu.max fact value to -1 (unlimited) for DRS-enabled VM host clusters.

6.8.3 Configuring vCPUs on VMs

An existing vCPU fact (resource.vm.vcpu) specifies the number of vCPUs for a VM. This fact is set on VM image discovery. You can view it in the Orchestration Console on the VM object Admin view on the Info/Groups page. The Virtual Machine Configuration pane on this page has a Host CPU Number field where this fact is set.

In the VM Hosts Monitor view, the tooltip for a VM host displays the following:

..Total vCPUs: xx, Available vCPUs: xx

Figure 6-1 Tool Tip Text for VM Host vCPU Slots

These values change when a VM is provisioned or shut down. For example, if the vmhost.vcpu.max fact is set to -1 (unlimited), then the tooltip shows “-1” for both total and available.