Add external_instance_event() method to compute manager

This would allow external services to send notifications in to
the compute manager, which could have one or more threads waiting
to be unblocked. It would also provide a way for us to process
generic events like "update your instance cache for $instance".

Related to blueprint admin-event-callback-api

Change-Id: If87cc7fdb1ebcfa2a1d33f5e864c43ed0290beb6
Add os-server-external-events API

Related to blueprint admin-event-callback-api

Change-Id: Ib09d5370622809e4bf1b5825eb9c223a115f7d33
Remove run-time dependency on fixtures module by the nova baremetal

Tripleo still uses this baremetal driver. The dependency on the python fixtures
was introduced by https://review.openstack.org/#/c/71219/

This dependency is causing devtest to stop working.

Change-Id: Id6deccce13698b083af492635ff88533c059fd35
Add add_members to InstanceGroup object

There is a db API method that safely adds a list of members to an
instance using a db session.  Expose it via the InstanceGroup object.

Part of blueprint instance-group-api-extension

Change-Id: I1b8349a82148bddf5cfbb7be3c8667f292df6602
Add instance to instance group in compute.api

When a user specifies an instance group via a scheduler hint, add the
instance to the instance group during instance creation in the compute
API.

Part of blueprint instance-group-api-extension

Change-Id: Ibad59412efecbd25c01e190c33da4bf28342e95b
Add get_hosts to InstanceGroup object

Add a method to the InstanceGroup object that will return a list of
hosts for all non-deleted instances in the group.

Testing this uses a nova.tests.utils method for creating an instance.
A tweak was needed in this test code to ensure that the user_id and
project_id were set on the instance that was created.  Otherwise, this
testing this new method on the InstanceGroup object failed since it
was filtering on the project_id.

Change-Id: Iaf27649ac30b4aa59a3d86f997aa30cfc3d29506
Initial scheduler support for instance_groups

Scheduler support for blueprint instance-group-api-extension

The scheduling code now uses the instance group object. This
patch set adds support for 'anti-affinity' and 'affinity'
policies.

Co-authored-by: Russell Bryant <rbryant@redhat.com>
Change-Id: I539424192727cf2a768d6b24ba9cf36dc56c9304
Fix anti-affinity race condition on boot

The scheduler enforces anti-affinity policy.  However, since
scheduling can happen in parallel for more than one instance, it's
possible for the scheduler to schedule an instance to a host that will
end up violating anti-affinity.

This patch updates the instance build code in the compute manager to
do an anti-affinity policy sanity check.  If the policy would be
violated by spawning the instance locally, an exception is raised so
that it gets rescheduled.

Part of blueprint instance-group-api-extension

Change-Id: I1358c36dff47b4ecd07841535aa0653d0f6ba823
Merge "Remove run-time dependency on fixtures module by the nova baremetal"
Merge "Add external_instance_event() method to compute manager"
Merge "Add os-server-external-events API"