Comment 3 for bug 1735407

Revision history for this message
Matt Riedemann (mriedem) wrote :

This is a valid bug, and the analysis in comment #2 is correct.

Since you can't evacuate multiple instances in the same request, the scheduler doesn't know about their relationship to each other and therefore might pick a host that ultimately is wrong.

There is a late affinity policy check in the compute for this latent scheduler behavior issue but it's only applied on the initial server create:

https://github.com/openstack/nova/blob/mitaka-eol/nova/compute/manager.py#L1447

The reason this "works" (at least a higher chance of working) when you space the evacuate calls out is that the computes have time to send information about their instances to the scheduler:

https://github.com/openstack/nova/blob/mitaka-eol/nova/compute/manager.py#L1777

https://github.com/openstack/nova/blob/mitaka-eol/nova/compute/manager.py#L1803

So when the subsequent evacuate requests are made, the scheduler has the information to pick a host properly based on the anti-affinity policy.

At this point, even in master (queens right now), we don't have a solution for this. Long-term we want to model affinity (distance between resource providers) in the Placement service and have the scheduler use that for these filtering decisions, but that's not something being worked on in Queens and I'm not even sure if we'll get the for the Rocky release.