Comment 14 for bug 1746863

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

Reviewed: https://review.openstack.org/599732
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3051a0d5d5639b451d6da5e9f490332399b18c54
Submitter: Zuul
Branch: stable/rocky

commit 3051a0d5d5639b451d6da5e9f490332399b18c54
Author: melanie witt <email address hidden>
Date: Fri Feb 2 05:41:20 2018 +0000

    Make scheduler.utils.setup_instance_group query all cells

    To check affinity and anti-affinity policies for scheduling instances,
    we use the RequestSpec.instance_group.hosts field to check the hosts
    that have group members on them. Access of the 'hosts' field calls
    InstanceGroup.get_hosts during a lazy-load and get_hosts does a query
    for all instances that are members of the group and returns their hosts
    after removing duplicates. The InstanceList query isn't targeting any
    cells, so it will return [] in a multi-cell environment in both the
    instance create case and the instance move case. In the move case, we
    do have a cell-targeted RequestContext when setup_instance_group is
    called *but* the RequestSpec.instance_group object is queried early in
    compute/api before we're targeted to a cell, so a call of
    RequestSpec.instance_group.get_hosts() will result in [] still, even
    for move operations.

    This makes setup_instance_group query all cells for instances that are
    members of the instance group if the RequestContext is untargeted, else
    it queries the targeted cell for the instances.

    Closes-Bug: #1746863

    Change-Id: Ia5f5a0d75953b1154a8de3e1eaa15f8042e32d77
    (cherry picked from commit 14f4c502f92b10b669044e5069ac3b3555a42ee0)