Add methods to Host operations to fake hypervisor

This patch implements some features present in os-hosts extension that are not
implemented in fake hypervisor:
    - Power Actions: Shutdown/Reboot/Startup a host
    - Change host status: enable or disable
    - Set/Unset the host into maintenance mode
With this patch we're able to get full api samples for this extension

Change-Id: I3b76e3070e326b39a67b9d4d25b5e3d91a3c102f
Make resize and multi-node work properly together

Added node support to migrations and update node properly in
'resize_instance'.

bug 1081355

Change-Id: I003d34e3f7ed9ce2feda19ee5ce210ed4ba7eaa1
Use flags() helper method to override config in tests

Setting config option values using setattr() is dangerous because the
value remains set even after the particular test finishes, so you can
end up with other tests relying on it and being unable to run tests
in isolation.

We have a helper method for doing this, just use it.

Change-Id: I872d7a4f70eceb9ff64f56901cb45552f237c733
Move imagecache code from nova.virt.libvirt.utils

The imagecache related code in libvirt.utils uses the base_dir_name
config option.

If we move the imagecache utils into imagecache, then we can move
the base_dir_name option into that module since there are no other
users of it.

Having all the imagecache code in the imagecache module seems like
a sensible thing to do anyway.

blueprint: scope-config-opts
Change-Id: I1e154aa4de1628d40964207bdcbe5b3b55076442
Move ec2 config opts to nova.api.ec2.cloud

Only ec2_dmz_host and ec2_port are used outside of ec2.cloud and in
both cases pipelib is the other module that uses them.

Move all the ec2 options to ec2.cloud and make pipelib explicitly
depend on the ones it needs.

blueprint: scope-config-opts
Change-Id: Ib187ec3421a25bdd86b13dfeae1dc9a07873eb43
Remove default_image config option

The value of this option hasn't been used outside of the tests since
the very early days of the project. There's no particular reason
to have a config option for this test value, so just delete it.

blueprint: scope-config-opts
Change-Id: I00a08d4dc539f92f4fa4bd8c3c8756e5029d193f
Merge "Make resize and multi-node work properly together"
Merge "Move imagecache code from nova.virt.libvirt.utils"
Merge "Move ec2 config opts to nova.api.ec2.cloud"
Merge "Use flags() helper method to override config in tests"
Merge "Remove default_image config option"
Merge "Add methods to Host operations to fake hypervisor"
Include 'hosts' and 'metadetails' in aggregate.

When converting an Aggregate sqlalchemy model to primitive types using
jsonutils.to_primitive(), the hosts and metadata were being left out.
This is because they are implemented as properties on the model and must
be explicitly listed as extra keys to be read.

We also want to make sure that the _hosts and _metadata are eager
loaded.  This patch ensures this gets done by adding it to the
_get_aggregate_query() helper, and making sure it is used everywhere
that is appropriate.  Also, on creation of the aggregate, just manually
set _hosts and _metadata to empty lists, since we know they're empty at
this point.

These changes caused a side effect to the os-aggreages API extension.
The result from creating an aggregate started including 'hosts' and
'metadata'.  There's a hack in there to maintain the same API result.
These don't add any value to this API call anyway, since we know they're
blank at this point.

Part of blueprint no-db-compute.

Change-Id: I4048ea6f477f7a695701eb3ba57f97afca0c0e41
Add aggregate_host_add to conductor.

Offload the db write for adding a host to a host aggregate to the
conductor service.

Part of blueprint no-db-compute.

Change-Id: I7c3da2d5c9fc6d7e72fb9371b7ea6a2b10c5218d
Add aggregate_host_delete to conductor.

Offload the db write for deleting a host from a host aggregate to the
conductor service.

Part of blueprint no-db-compute.

Change-Id: I9a3ae191a3366d9c890847c0d810272da637c64f