Add debug log for core_filter
Sometimes operator need information why the host doesn't pass the check of scheduler, this patch adds information for core filter if virtual cpu is not enough on the host. Change-Id: Ie05d9184435a4fc4cff1af26812c01a3cc226fff Partial-Bug: #1301830
This commit is contained in:
@@ -61,7 +61,17 @@ class BaseCoreFilter(filters.BaseHostFilter):
|
||||
if vcpus_total > 0:
|
||||
host_state.limits['vcpu'] = vcpus_total
|
||||
|
||||
return (vcpus_total - host_state.vcpus_used) >= instance_vcpus
|
||||
free_vcpus = vcpus_total - host_state.vcpus_used
|
||||
if free_vcpus < instance_vcpus:
|
||||
LOG.debug("%(host_state)s does not have %(instance_vcpus)d "
|
||||
"usable vcpus, it only has %(free_vcpus)d usable "
|
||||
"vcpus",
|
||||
{'host_state': host_state,
|
||||
'instance_vcpus': instance_vcpus,
|
||||
'free_vcpus': free_vcpus})
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
class CoreFilter(BaseCoreFilter):
|
||||
|
||||
Reference in New Issue
Block a user