FUP for Ib62ac0b692eb92a2ed364ec9f486ded05def39ad
This addresses some nits from that review related to the tense in the docs and no longer valid code comments in the resource tracker. Change-Id: Idde7ef4e91d516b8f225118862e36feda4c8a9d4
This commit is contained in:
parent
f199811af4
commit
9fd0b9a850
@ -25,8 +25,8 @@ In the movement towards using placement for scheduling and resource management,
|
|||||||
the virt driver method ``get_available_resource`` was initially superseded by
|
the virt driver method ``get_available_resource`` was initially superseded by
|
||||||
``get_inventory`` (now gone), whereby the driver could specify its inventory in
|
``get_inventory`` (now gone), whereby the driver could specify its inventory in
|
||||||
terms understood by placement. In Queens, a ``get_traits`` driver method was
|
terms understood by placement. In Queens, a ``get_traits`` driver method was
|
||||||
added. But ``get_inventory`` is limited to expressing only inventory (not
|
added. But ``get_inventory`` was limited to expressing only inventory (not
|
||||||
traits or aggregates). And both of these methods are limited to the resource
|
traits or aggregates). And both of these methods were limited to the resource
|
||||||
provider corresponding to the compute node.
|
provider corresponding to the compute node.
|
||||||
|
|
||||||
Developments such as Nested Resource Providers necessitate the ability
|
Developments such as Nested Resource Providers necessitate the ability
|
||||||
|
@ -1089,15 +1089,14 @@ class ResourceTracker(object):
|
|||||||
"""Send resource and inventory changes to placement."""
|
"""Send resource and inventory changes to placement."""
|
||||||
# NOTE(jianghuaw): Some resources(e.g. VGPU) are not saved in the
|
# NOTE(jianghuaw): Some resources(e.g. VGPU) are not saved in the
|
||||||
# object of compute_node; instead the inventory data for these
|
# object of compute_node; instead the inventory data for these
|
||||||
# resource is reported by driver's get_inventory(). So even there
|
# resource is reported by driver's update_provider_tree(). So even if
|
||||||
# is no resource change for compute_node as above, we need proceed
|
# there is no resource change for compute_node, we need proceed
|
||||||
# to get inventory and use report client interfaces to update
|
# to get inventory and use report client interfaces to update
|
||||||
# inventory to placement. It's report client's responsibility to
|
# inventory to placement. It's report client's responsibility to
|
||||||
# ensure the update request to placement only happens when inventory
|
# ensure the update request to placement only happens when inventory
|
||||||
# is changed.
|
# is changed.
|
||||||
nodename = compute_node.hypervisor_hostname
|
nodename = compute_node.hypervisor_hostname
|
||||||
# Persist the stats to the Scheduler
|
# Persist the stats to the Scheduler
|
||||||
# First try update_provider_tree
|
|
||||||
# Retrieve the provider tree associated with this compute node. If
|
# Retrieve the provider tree associated with this compute node. If
|
||||||
# it doesn't exist yet, this will create it with a (single, root)
|
# it doesn't exist yet, this will create it with a (single, root)
|
||||||
# provider corresponding to the compute node.
|
# provider corresponding to the compute node.
|
||||||
@ -1154,10 +1153,11 @@ class ResourceTracker(object):
|
|||||||
nodename = compute_node.hypervisor_hostname
|
nodename = compute_node.hypervisor_hostname
|
||||||
old_compute = self.old_resources[nodename]
|
old_compute = self.old_resources[nodename]
|
||||||
if self._resource_change(compute_node):
|
if self._resource_change(compute_node):
|
||||||
# If the compute_node's resource changed, update to DB.
|
# If the compute_node's resource changed, update to DB. Note that
|
||||||
# NOTE(jianghuaw): Once we completely move to use get_inventory()
|
# _update_to_placement below does not supersede the need to do this
|
||||||
# for all resource provider's inv data. We can remove this check.
|
# because there are stats-related fields in the ComputeNode object
|
||||||
# At the moment we still need this check and save compute_node.
|
# which could have changed and still need to be reported to the
|
||||||
|
# scheduler filters/weighers (which could be out of tree as well).
|
||||||
try:
|
try:
|
||||||
compute_node.save()
|
compute_node.save()
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user