Max_unit should account for allocation_ratio

Bug #1707085 reported by Ying Zuo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Unassigned

Bug Description

It's great that the Placement API v1.4 provides a way to query for hosts that can fulfill a set of allocations. However, because the max_unit doesn't account for allocation_ratio, the result is not as expected.

For example, my host has a total of 4 vCPU and 2 vCPU have been allocated. cpu_allocation_ratio is 3. I expect that this host is considered a qualified host if I make a request to the <placement api>/resource_providers?resources=VCPU:5 because Capacity = (total-reserved) x allocation_ratio - used which is 10. However, because the max_unit is set as the total which is 4, my host is not in the response although it can fulfill the requested allocation.

Ying Zuo (yingzuo)
description: updated
Ying Zuo (yingzuo)
description: updated
Revision history for this message
Sean Dague (sdague) wrote :

Self over allocating VCPUs is not a good idea. If your machine only has 4 CPUs and you expose that as 5 CPUs to a guest, you'll get pathologically bad performance as the guest tries to optimize workloads across those, which are causing cache flushes in the CPUs below.

Definitely in the Won't Fix category

Changed in nova:
status: New → Won't Fix
Revision history for this message
Chris Dent (cdent) wrote :

Just to build on what Sean's already said: one guest should not have more vcpus than the total number of available physical cpus. This is why max_unit gets set to what it is set at.

Note that if you requested a new guest with 4 VCPUs, it would get placed. max_unit describes the limit per guest, where allocation_ratio modifies the limits overall. So you can oversubscribe as much as you like across many guests, but not per individual guest (as that would cause the pathological performance Sean describes).

Revision history for this message
Ying Zuo (yingzuo) wrote :

Sean Dague and Chris Dent,

Thanks for the clarification.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.