[openstack-dev] [nova] question about e41fb84 "fix anti-affinity race condition on boot"
chris.friesen at windriver.com
Mon Mar 17 22:08:49 UTC 2014
On 03/17/2014 02:30 PM, Sylvain Bauza wrote:
> There is a global concern here about how an holistic scheduler can
> perform decisions, and from which key metrics.
> The current effort is leading to having the Gantt DB updated thanks to
> resource tracker for scheduling appropriately the hosts.
> If we consider these metrics as not enough, ie. that Gantt should
> perform an active check to another project, that's something which needs
> to be considered carefully. IMHO, on that case, Gantt should only access
> metrics thanks to the project REST API (and python client) in order to
> make sure that rolling upgrades could happen.
> tl;dr: If Gantt requires accessing Nova data, it should request Nova
> REST API, and not perform database access directly (even thru the conductor)
Consider the case in point.
1) We create a server group with anti-affinity policy. (So no two
instances in the group should run on the same compute node.)
2) We boot a server in this group.
3) Either simultaneously (on a different scheduler) or immediately after
(on the same scheduler) we boot another server in the same group.
Ideally the scheduler should enforce the policy without any races.
However, in the current code we don't update the instance entry in the
database with the chosen host until we actually try and create it on the
host. Because of this we can end up putting both of them on the same
Currently we only detect the problem when we go to actually boot the
instance on the compute node because we have a special-case check to
validate the policy. Personally I think this is sort of a hack and it
would be better to detect the problem within the scheduler itself.
This is something that the scheduler should reasonably consider. I see
it as effectively consuming resources, except that in this case the
resource is "the set of compute nodes not used by servers in the server
More information about the OpenStack-dev