Comment 13 for bug 1889633

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/train)

Reviewed: https://review.opendev.org/748255
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=44676ddf843ba84e26721cd2e3f65dc45a881f66
Submitter: Zuul
Branch: stable/train

commit 44676ddf843ba84e26721cd2e3f65dc45a881f66
Author: Stephen Finucane <email address hidden>
Date: Thu Jul 30 17:36:24 2020 +0100

    hardware: Reject requests for no hyperthreads on hosts with HT

    Attempting to boot an instance with 'hw:cpu_policy=dedicated' will
    result in a request from nova-scheduler to placement for allocation
    candidates with $flavor.vcpu 'PCPU' inventory. Similarly, booting an
    instance with 'hw:cpu_thread_policy=isolate' will result in a request
    for allocation candidates with 'HW_CPU_HYPERTHREADING=forbidden', i.e.
    hosts without hyperthreading. This has been the case since the
    cpu-resources feature was implemented in Train. However, as part of that
    work and to enable upgrades from hosts that predated Train, we also make
    a second request for candidates with $flavor.vcpu 'VCPU' inventory. The
    idea behind this is that old compute nodes would only report 'VCPU' and
    should be useable, and any new compute nodes that got caught up in this
    second request could never actually be scheduled to since there wouldn't
    be enough cores from 'ComputeNode.numa_topology.cells.[*].pcpuset'
    available to schedule to, resulting in rejection by the
    'NUMATopologyFilter'. However, if a host was rejected in the first
    query because it reported the 'HW_CPU_HYPERTHREADING' trait, it could
    get picked up by the second query and would happily be scheduled to,
    resulting in an instance consuming 'VCPU' inventory from a host that
    properly supported 'PCPU' inventory.

    The solution is simply, though also a huge hack. If we detect that the
    host is using new style configuration and should be able to report
    'PCPU', check if the instance asked for no hyperthreading and whether
    the host has it. If all are True, reject the request.

    Change-Id: Id39aaaac09585ca1a754b669351c86e234b89dd9
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1889633
    (cherry picked from commit 9c270332041d6b98951c0b57d7b344fd551a413c)
    (cherry picked from commit 7ddab327675d36a4ba59d02d22d042d418236336)