Cells: Add support for compute HostAPI()

This will allow the hosts API extension to work. Calls to get service
information from the DB are proxied via cells.

When using the host extension, the 'id' and 'host' fields for
service/compute will be modified to have the cell prepended to it.  One
can do a 'show' on a 'path!to!cell@id' to see details for a particular
host in the 'path!to!cell' cell, for instance.

Implements bp/nova-compute-cells

Change-Id: I8137fa64d2578acfc3d2457c231de2b0d69b96d8
Update en_US message translations.

Fixes bug 1101587.

* nova/locale/en_US/LC_MESSAGES/nova.po: This "translation" was
woefully outdated, causing KeyError exceptions under a number of
circumstances for users of this particular locale when format
strings wound up containing incorrect substitution variables. This
change attempts to sync up the msgstr entries to match msgid given
this is the source language for the pot file. I did not see any
obvious instances where en_US should differ from C locale for these.

Change-Id: I81d1729fee17653b089f3c47db20f3fc073ab363
Add support for memory overcommit in live-migration

Override the live-migration memory check in FilterScheduler and
make it use RamFilter for checking available memory on target
host.

Resolves bug 1068258.

Change-Id: I3002b8330e595ce71e2718b2091d3b0b99747707
Remove hardcoded topic strings in network manager

Resolves bug 1107799.

Change-Id: I24e26fb53e9d4db709307280ef23241c6c4b09ae
Add REST API to show availability_zone of instance.

Implement one workitem for bp:show-availability-zone

This show the availability zone and availability zone of its host in
API: GET /servers/details, GET /server/{uuid}.

When create instance if "availability_zone" doesn't specified, the
"availability_zone" of the instance will be None.  But actually the instance
is in a zone which its host is in. So I think show both of them will be fine.

Change-Id: I2d742ee2d291b514bf783fa79293785cca8ea2a5
Add API sample tests to os-network

Partially implements blueprint nova-api-samples
Bug 1070170

Change-Id: I24c708e59e4fe5fcc17be0ae9b7fcb294278a175
separate libvirt injection and configdrive config variables

This is mostly a refactoring so that if config drive is required,
variable lookup only needed for the injection case, is avoided.

There is a functional change here to make 'admin_pass' consistent
with the other variables in that the libvirt_inject_password flag
now does _not_ control whether the admin password is placed
in the config drive.

Change-Id: Ib79971aa050e56e5aa72fdd69aadd7539b2bd315
Fix import for install_venv.py

On systems that don't use devstack the nova directory
doesn't automatically get added to the python path. This
breaks tools/install_venv_common.py which imports from
nova.openstack.common. This fixes the issue by manually
adding the nova root directory to the python path before
tools/install_venv_common.py is imported.

Change-Id: I8a3df02a51c2c777d8f47cb8bc72d0644ae47095
Default value of monkey_patch_modules is broken

The default value of monkey_patch_modules has not kept up with
the move of notifier to openstack.common

Without this change setting 'monkey_patch=True' in nova.conf
will cause runtime errors unless the monkey_patch_modules
is also specified pointing to the correct notifier

Change-Id: Ib22faa7404b09791799338de2edfe0ddcd662d5f
Added Postgres CI opportunistic test case

Added test case and support functions for CI opportunistic testing
using a PostgreSQL database, as part of our postgresql as a first
class citizen effort.

rebased again on top of test migration with data framework

clean up debug, and ensure pg will fail to connect gracefully

fix previous migration test which was inserting a key by id, which
postgresql doesn't like, as it doesn't adjust the autoincrement
counter.

added driver to connection string for mysql

Updated comment to expose how to do this on pg easily

Fixes:
bug 1084567

Change-Id: If0bfe5cf748f6d5724d17082be6d18b6f96f6ee4
Use oslo database code

Bring in the new database code from oslo.

Uses get_session() from oslo as well as changing NovaBase to derive from
a common class.

Remove test_sqlalchemy.py now that this code is test in oslo.

Implements blueprint db-common.

Change-Id: I090754981c871250dd981cbbe1a08e7181440120
Move libvirt NFS volume driver impl into volume.py

For inexplicable reasons the NFS volume driver was put into a
different file than all the other libvirt volume driver impls.
The NFS code isn't so large & complex that it needs to be in
a different place than everything else. Move the code into
the main volume.py file.

To avoid breaking existing deployments, the original class
has to be a trivial subclass of the new module. Any use of it
will trigger a deprecation warning. This allows time for users
to update their 'libvirt_volume_drivers' config (in the unlikely
event they have altered from the default setting).

Change-Id: I26d957e4ee33938b45dc1cad0fe32a2968520a4a
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Move libvirt volume driver tests to separate test case

The libvirt volume code is in a separate module from the
main libvirt driver code, so it makes sense for the test
suite to be separated too, to make it easy to quickly
run just the volume tests. This has the added advantage
of reducing the size of the enourmous test_libvirt.py
file which is becoming unwieldly.

Change-Id: I7c6134992055694798c4ec3217483bc3a41d89eb
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
lxc: Clean up namespace mounts

5f697f64e5c445ba1b62c82d9167fd6b9c7256d2 introduced a regression
when using lxc containers with qcow2 and qemu-nbd.

When removing the rootfs from the host namespace, it would
terminate the qemu-nbd process as well. This would cause
the kernel too oops under Ubuntu 13.04. Since the underlying
device thtat the libvirt_lxc process disapears.

To get around this we just clean up the host namespace if the
instance is powered-on. When the instance terminates it will
teardown the whole container.

This fixes LP: #1115786

Change-Id: I98bec2338cb455dbd277295ab36767149e05634c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Refactor server password metadata to avoid direct db usage

This refactors the set_password() method in the server_password
API extension to merely format the metadata and return it, leaving
the job of updating the database to the caller. In the API extension
case, the update can be done immediately against the database as
before. In the case of the metadata API handler and the xenapi virt
driver making the call, conductor can be used to update the instance's
system_metadata, thereby avoiding a direct database access.

Related to blueprint no-db-compute

Change-Id: I0563feaa97d768a96f950c148b1dbf51c356c4ac
Merge "Fix import for install_venv.py"
Merge "Add REST API to show availability_zone of instance."
Remove unused methods.

These methods were added in 3f7353d14183a93099c99dc2fc72614265f1c72c but
are not used anywhere in the code.  Just remove them.

Change-Id: I2b55901bb6119d83586fb2ffa877bbd00a8d43b3
Merge "Refactor server password metadata to avoid direct db usage"
Refactor instance usage notifications for compute manager

This patch makes compute manager call notify_usage_exists() via the
conductor instead of directly, avoiding the direct database access
required to fetch bandwidth information. I initially just added
a notify_bw_usage() method to conductor, which just handled the
bandwidth part (which is the database hit). However, the metadata
payload part may be depended upon by custom stuff for periodic
notifications, so copying all that stuff as well made it a bunch
of duplicated stuff. Thus, I decided to just make it a direct proxy
for the compute_utils method.

Note that this is a bit of a departure from the previous pattern of
just proxying db interfaces in conductor, but I think the simplicity
gain is worth it.

Related to blueprint no-db-compute

Change-Id: I09f2652d4903f4d6036c6e3d74db063952341856