Search code examples
openstackvcpu

Nova Compute - about cpu_allocation_ratio


Compute node running on Physical server with 40 CPUs. Though cpu_allocation_ratio set to 4.0, scheduler_default_filters set to "RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter,ImagePropertiesFilter,JsonFilter,CoreFilter", when we check the vPCus count via nova hypervisor stat it only lists 40 vcpus.

Shouldn't it be 160 vcpus?


Solution

  • Oversubscription amounts are built into the scheduler logic to figure out how many resources are available, however this data doesn't make it into Horizon/other areas. If you have 20 Physical CPUs with hyperthreading you'll end up with 40 VCPUs, which is what Nova is aware of. When you set the allocation ratio to 4.0, you still have 40 vCPUs but you are allowing nova to oversub them by 4x.

    It would be helpful to see the total of available vCPUs based on the oversub, however the number would not be accurate. Instead we end up with a negative resource usage amount, which shows how many vCPUs have been used over the total amount, which is 40 in this case. When we hit 41 we have used all 40 + 1, which gives us -1 available vCPUs.