Skip to content

Commit

Permalink
update 'hw:cpu_model' meta data to support *-IBRS vcpu type
Browse files Browse the repository at this point in the history
after libvirt upgraded to 4.7.0, there are some new vcpu types for
instance vcpu_model, if compute node is using *-IBRS cpu,
Passthrough favor can not be used for creating instance.
it will cause some like below error
"No valid host was found. There are not enough hosts available.
 computer-0: (VCpuModelFilter) Host VCPU model Skylake-Server-IBRS
 required Passthrough
 Code 501"

Closes-Bug: 1803280

Signed-off-by: Sun Austin <austin.sun@intel.com>

update 'hw:cpu_model' meta data to support *-IBRS vcpu type

after libvirt upgraded to 4.7.0, there are some new vcpu types for
instance vcpu_model, if compute node is using *-IBRS cpu,
Passthrough favor can not be used for creating instance.
it will cause some like below error
"No valid host was found. There are not enough hosts available.
 computer-0: (VCpuModelFilter) Host VCPU model Skylake-Server-IBRS
 required Passthrough
 Code 501"

filter return false guest request 'IBRS type CPU'
if host does not support "IBRS"

Closes-Bug: 1803280

Signed-off-by: Sun Austin <austin.sun@intel.com>
  • Loading branch information
sunausti committed Nov 17, 2018
1 parent 3b23268 commit 3255fac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nova/objects/fields.py
Expand Up @@ -347,14 +347,23 @@ class CPUModel(BaseNovaEnum):
"Conroe",
"Penryn",
"Nehalem",
"Nehalem-IBRS",
"Westmere",
"Westmere-IBRS",
"SandyBridge",
"SandyBridge-IBRS",
"IvyBridge",
"IvyBridge-IBRS",
"Haswell",
"Haswell-IBRS",
"Broadwell-noTSX",
"Broadwell-noTSX-IBRS",
"Broadwell",
"Broadwell-IBRS",
"Skylake-Client",
"Skylake-Server")
"Skylake-Client-IBRS",
"Skylake-Server",
"Skylake-Server-IBRS")


class CPUMatch(BaseNovaEnum):
Expand Down
6 changes: 6 additions & 0 deletions nova/scheduler/filters/vcpu_model_filter.py
Expand Up @@ -49,6 +49,12 @@ def _is_compatible(self, host, guest):
# The guest CPU model is not in our list. We can't tell whether
# we can support it or not.
return False

# if guest request IBRS cpu, but host does not support 'IBRS', then
# return false directly
if('IBRS' in guest and 'IBRS' not in host):
return False

return bool(guest_index <= host_index)

def _passthrough_host_passes(self, host_state, spec_obj):
Expand Down

0 comments on commit 3255fac

Please sign in to comment.