← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1746615] [NEW] Report client can try to ensure a standard resource class

 

Public bug reported:

SchedulerReportClient.set_inventory_for_provider uses this logic [1] to
pre-create custom resource classes found in the input inventory.

        list(map(self._ensure_resource_class,
                 (rc_name for rc_name in inv_data
                  if rc_name not in fields.ResourceClass.STANDARD)))

The problem is that this relies on the local system's notion of the set
of standard resource classes.  If the placement service is running newer
code, standard resource classes may have been added that the compute
service doesn't know about yet.  If a consumer attempts to use such a
resource class, the above block will attempt to _ensure_resource_class
on it, which attempts to create it in placement, which results in a 400
(because the schema requires it to begin with CUSTOM_), which results in
InvalidResourceClass exception, and the consumer can't use that resource
class.

We should never be relying on placement code directly on the compute
node.  (This includes introspecting os-traits.)  We should always be
asking the placement service.

[1]
https://github.com/openstack/nova/blob/894dd5b87674d396c7221f9d1bca3a9a983dfeb8/nova/scheduler/client/report.py#L983-L985

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: placement

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1746615

Title:
  Report client can try to ensure a standard resource class

Status in OpenStack Compute (nova):
  New

Bug description:
  SchedulerReportClient.set_inventory_for_provider uses this logic [1]
  to pre-create custom resource classes found in the input inventory.

          list(map(self._ensure_resource_class,
                   (rc_name for rc_name in inv_data
                    if rc_name not in fields.ResourceClass.STANDARD)))

  The problem is that this relies on the local system's notion of the
  set of standard resource classes.  If the placement service is running
  newer code, standard resource classes may have been added that the
  compute service doesn't know about yet.  If a consumer attempts to use
  such a resource class, the above block will attempt to
  _ensure_resource_class on it, which attempts to create it in
  placement, which results in a 400 (because the schema requires it to
  begin with CUSTOM_), which results in InvalidResourceClass exception,
  and the consumer can't use that resource class.

  We should never be relying on placement code directly on the compute
  node.  (This includes introspecting os-traits.)  We should always be
  asking the placement service.

  [1]
  https://github.com/openstack/nova/blob/894dd5b87674d396c7221f9d1bca3a9a983dfeb8/nova/scheduler/client/report.py#L983-L985

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1746615/+subscriptions


Follow ups