Adds live migration support to cells API

Fixes bug 1153087

DocImpact: Cells now allows live migration within a cell,
but not between cells.

Conflicts:
	nova/tests/compute/test_compute_cells.py

Change-Id: Ic8777c376883eaf6ff9cb4b379e0bacbfe5635b7
Cells: Add filtering and weight support

This adds filtering and weighing support to the cells scheduler.

Adds the following config options to the 'cells' group:

scheduler_filter_classes -- list of filter classes
scheduler_weight_classes -- list of weight classes

Adds a couple of weighing modules as defaults (which removes the random
cell selection):

ram_by_instance_type: Select cells with the most capacity for the
instance type being requested.
weight_offset: Allows modifying the DB to weight a particular cell
(useful for disabling a cell)

Adds a filter class (TargetCellFilter) that allows specifying a scheduler
hint to direct a build to a particular cell if you're an admin.

DocImpact

Implements blueprint cells-filter-scheduler

Change-Id: I027c5734e3d6134127fcd4dd28b8ff39047416dc

Conflicts:

	nova/cells/scheduler.py
	nova/filters.py
	nova/tests/test_filters.py
Cell weighing class to handle mute child cells

Give negative weight to child cells that have not recently sent
capability or capacity updates to their parent cell.

Change-Id: I7cada3e1b6f04c48b71c82d8e0a8527e44674abd
Make the host aggregate functionality work with cells

 + In the openstack api, it moves database access and other
   functionality to the nova.compute layer
 + It adds support for aggregates in the nova.compute.cells_api
 + It adds the following host aggregate related functions to the cells
   rpcapi and messaging systems:
     * create_aggregate(self, ctxt, aggregate_name, availability_zone)
     * get_aggregate(self, ctxt, aggregate_id)
     * get_aggregate_list(self, ctxt, cell=None)
     * update_aggregate(self, ctxt, aggregate_id, values)
     * update_aggregate_metadata(self, ctxt, aggregate_id, metadata)
     * delete_aggregate(self, ctxt, aggregate_id)
     * add_host_to_aggregate(self, ctxt, aggregate_id, host_name)
     * remove_host_from_aggregate(self, ctxt, aggregate_id, host_name)

Change-Id: I079f767ad1c4e966c22d6722c0dfea6d5f35c54d

Conflicts:

	nova/cells/manager.py
	nova/cells/rpcapi.py
Fix up tests for cell aggregates

Change-Id: Ie8e2f31973f6f13c71e2348e91b026822f9515cf
Support consoleauth at child cells

Conflicts:

	nova/cells/manager.py
	nova/cells/messaging.py
	nova/cells/rpcapi.py
Change arguments to volume_detach()

Most compute API calls accept an instance object.  To be compatible with
cells, volume_detach() should as well.  Also change it to accept the
volume object, instead of just a volume ID.  This lets us proxy the
volume object to child cells a bit more easily.

This removes 2 skipTests that we have related to volumes and cells.

Fixes bug 1157408

There was also a check that if instance_get_by_uuid() returned no
instance, it VolumeUnattached should be raised.  However, this check
would never work as InstanceNotFound would have been raised.  This
patch also corrects that.

Change-Id: Ide35ad5d8e147f6bd21b5840b901363dab0eae38
Cells: Add support for global cinder

Implements cinder support for compute cells when cinder is a global
installation.  Adds syncing of the block device mapping table between
child cells and API cells.

Implements blueprint cells-cinder-support

Change-Id: Ife5be9922db0742c8ee4f970517396be86597cce

Conflicts:

	nova/cells/manager.py
	nova/cells/rpcapi.py
	nova/db/sqlalchemy/api.py

Conflicts:

	nova/cells/manager.py
	nova/cells/messaging.py
	nova/cells/rpcapi.py
	nova/tests/cells/test_cells_manager.py
	nova/tests/cells/test_cells_messaging.py
	nova/tests/cells/test_cells_rpcapi.py
Cells: Event-based secgroup/rule/assoc syncing

Conflicts:

	nova/cells/manager.py
	nova/cells/messaging.py
	nova/cells/rpcapi.py
	nova/compute/cells_api.py
	nova/tests/cells/test_cells_messaging.py
	nova/tests/cells/test_cells_rpcapi.py
Cells: DB healing for groups/rules/instance assocs
Healing for EC2 inst/vol and S3 image mappings

Conflicts:
	nova/cells/consistency.py
	nova/cells/manager.py
	nova/cells/messaging.py
	nova/cells/rpcapi.py
	nova/compute/cells_api.py
	nova/db/api.py
	nova/tests/cells/test_cells_messaging.py
	nova/tests/cells/test_cells_rpcapi.py
AZ support when using cells

Conflicts:

	nova/cells/manager.py
	nova/cells/messaging.py
	nova/cells/rpcapi.py
Support a list of hosts in RPC server_params

(cherry picked from commit f3cf5ad6e513a2c4e8174ad259b57956468fa426)
Support a list of hosts in rpc_host cell db field

(cherry picked from commit 2eee732a1b44bd4bb10e6bff14eef15d6e526ced)
Use instance uuid when getting security groups for instance
Added missing import
Pass libvirt name to API via system metadata

When cells does an instance update broadcast upwards, add the
libvirt instance name to the instance's system metadata.

When cells is enabled, use this in the API implementation as the source
of instance_name and display nothing if it's missing, rather than
something misleading.

Change-Id: Id45768eaa5394f8d0f8ced16cdd285f66568dd7d
Expire reservations in cells manager

Normally reservations are expired by a periodic task in nova-scheduler.
In a cells deployment quotas are usually enabled only on the api-level
cell. This uses a separate DB from the scheduler, so any reservations
on the top level never get expired.

This change adds the same periodic task to the cells manager so
reservations at all levels have a chance to be expired. The task is
disabled by default and can be turned on with the
CONF.cells.expire_reservations option.

Change-Id: I217f5b5e947662a858eb295f2add5c3227c3b531