← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1687067] Re: problems with cpu and cpu-thread policy where flavor/image specify different settings

 

Ok, given the docs are fixed, lets put this into Opinion (which is a
closed state) for the actual code changes which don't have concensus.

** Changed in: nova
       Status: New => Opinion

-- 
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/1687067

Title:
  problems with cpu and cpu-thread policy where flavor/image specify
  different settings

Status in OpenStack Compute (nova):
  Opinion

Bug description:
  nova version: Newton (and later)

  There are a number of issues related to CPU policy and CPU thread
  policy where the flavor extra-spec and image properties do not match
  up.

  The docs at https://docs.openstack.org/admin-guide/compute-cpu-
  topologies.html say the following:

  "Image metadata takes precedence over flavor extra specs. Thus,
  configuring competing policies causes an exception. By setting a
  shared policy through image metadata, administrators can prevent users
  configuring CPU policies in flavors and impacting resource
  utilization."

  For the CPU policy this is exactly backwards based on the code.  The
  flavor is specified by the admin, and so it generally takes priority
  over the image which is specified by the end user.  If the flavor
  specifies "dedicated" then the result is dedicated regardless of what
  the image specifies.  If the flavor specifies "shared" then the result
  depends on the image--if it specifies "dedicated" then we will raise
  an exception, otherwise we use "shared".  If the flavor doesn't
  specify a CPU policy then the image can specify whatever policy it
  wants.

  The issue around CPU threading policy is more complicated.

  Back in Mitaka, if the flavor specified a CPU threading policy of
  either None or "prefer" then we would use the threading policy
  specified by the image (if it was set).  If the flavor specified a CPU
  threading policy of "isolate" or "require" and the image specified a
  different CPU threading policy then we raised
  exception.ImageCPUThreadPolicyForbidden(), otherwise we used the CPU
  threading policy specified by the flavor.  This behaviour is described
  in the spec at https://specs.openstack.org/openstack/nova-
  specs/specs/mitaka/implemented/virt-driver-cpu-thread-pinning.html

  In git commit 24997343 (which went into Newton) Nikola Dipanov made a
  code change that doesn't match the intent in the git commit message:

       if flavor_thread_policy in [None, fields.CPUThreadAllocationPolicy.PREFER]:
  -        cpu_thread_policy = image_thread_policy
  +        cpu_thread_policy = flavor_thread_policy or image_thread_policy

  The effect of this is that if the flavor specifies a CPU threading
  policy of "prefer" then we will use a policy of "prefer" regardless of
  the policy from the image.  If the flavor specifies a CPU threading
  policy of None then we will use the policy from the image.

  This is a bug, because the original intent was to treat None and
  "prefer" identically, since "prefer" was just an explicit way to
  specify the default behaviour.

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


References