Return to skipping filters when using force_hosts.

The folsom behavior was to skip filtering when using force_hosts.
This is useful for administrative tools. For example, one can verify
a disabled node by launching instances on it even though the scheduler
will ignore it for normal requests. This behavior was accidentally
changed in commit 0d9ce8319d75bfbd69fe4e0759aeed38e6054e56

Change-Id: Ib529cf8eccc4d8abe67873cfc0467f6db9d4b522
Default the last parameter (state) in task_log_get to None

Change the method signature to match the other definitions
of task_log_get

Fixes LP# 1117263

Change-Id: I510c05d4520c579bf07953d9ed05d7a58e051695
hypervisor-supplied-nics support in PowerVM

PowerVM does not allow MAC addresses to be directly set on LPARs.
Instead, use the hypervisor-supplied-nics feature to generate MAC
addresses we can ensure are provisioned correctly.

blueprint powervm-compute-resize-migration

Change-Id: Idad7f03d9fd61970912ec1a6978fc0af56309df4
Change forward_bridge_interface to MultiStrOpt

The config option specifically mentions it can be set multiple times
but it was accidentally set to a ListOpt instead of a MultiStrOpt.

Change-Id: Ibc4280c4bbdd10655192fb8bb5a810125555eb6d
Add regression testing tool

Tool detects if a gerrit patch contains tests to detect a regression

Usage: ./tools/regression_tester.py gerrit_review_number

Change-Id: I6353d1efda73fe5fc3098f928b6da9a28eb40590
Fix inject_files for storing binary file.

Now a nova-api server decodes injected_files by base64 after receiving
encoded files from nova-client.
And the server fails to publish run_instance because utf8 codec can't
decode due to binary data.

This patch fixes this problem, because the base64 decode is operated when
a nova-compute server receives injected_files from a nova-api server.

Fixes bug 1112134

Change-Id: I664134c74893a970de4464161071692a5b2b5ce7
Move security_groups refreshes to conductor

This moves the last bit of compute-initiated db accesses found during
test runs to conductor. The quantum API was hitting the database directly
while calling back to compute's API to trigger the refresh. This just
makes the quantum API ask conductor to do that in a similar way to the
usage notifications patch recently merged.

Related to blueprint no-db-compute

Change-Id: I44de7e1e12aec291b8319d45ec5975ad05b8e676
Ban database access in nova-compute

This adds a wedge between nova-compute and the database implementation
to specifically catch, log, and deny accesses. Theoretically, this
should not be needed as a production environment would not even have
the compute nodes configured to talk to the database. However, testing
and upgraded environments may retain database access and thus avoid
hitting real issues that can be fixed up prior to release. Putting
this into the tree now will help ensure we have a consistent error
scenario for test setups prior to release.

Note that if nova is configured to use a local conductor, we do not
insert the wedge, which provides an easy out for anyone needing to
get a production system past a missed database access.

Related to bp no-db-compute.

Based on Russell's original tracer hack:

   I328fa92d5bfdadd5022f5c7efe981396d8ae7962

Change-Id: I478230220633e0d2ff94b6a4d756e07eab8517d7
Fix lazy load 'system_metadata' failed problem.

When using lazy load of SQLAlchemy, parent instance may have
a problem not bouding to a session object and fail the lazy loading
system_metadata.
Using joinedload to eagly load the system_metadata in
_instance_get_all_query to fix the problem.

Fixes: bug 1117232
Change-Id: Id24ca534f6eb57167aee22aca12c1274c90baf3c
Cells: Add cells support to instance_usage_audit_log api extension

Adds task_log_get_all() call to HostAPI() so that we can use the local
DB when cells is disabled or proxy via cells if cells is enabled.

Adds task_log_get_all() call to cells.

Change-Id: I9e78c17fcf70f98903d0a26c1de3e2581b8977ad
Cells: Add cells support to hypervisors extension

This removes the DB calls from the extension and moves them into
HostAPI().  The cells version of HostAPI() proxies them to the
appropriate cell or cells.

Change-Id: I17ff10e62d2f10b85a557edcc1509ca3b0d15a29
Recache or rebuild missing images on hard_reboot

The primary purpose of this change is to provide the ability to
re-cache missing backing files on hard_reboot. The old
pre_block_migration function was already performing a very similar
operation. That function has been refactored to be idempotent and
renamed to _create_images_and_backing. The pre_block_migration
function is a wrapper, with some additional checking, around the
renamed function.

Image backend was also adjusted to look for either a missing backing
file or disk image, recaching or creating accordingly. It should
also be idempotent, never clobbering existing images.

Change-Id: Icf4c488d6db59e732b463d08d0606b428ee1e7b9
Support hypervisor supplied macs in nova-network

When hypervisors supply a set of MAC addresses for instances, have
nova-network use the supplied values when creating VIFs.

This function is required for the PowerVM driver to be properly
supported.

Change-Id: I922797af6b2b829561f61095bef2098c2d31cde5
Merge Libvirt....VirtualPortDriver class into LibvirtGenericVIFDriver

The LibvirtOpenVswitchVirtualPortDriver VIF driver and the
LibvirtOpenVswitchDriver VIF driver both support OpenVswitch
based guest configs. The only difference is that the former
uses libvirt's modern <network type='bridge'> with vport
profile specified, while the latter uses <network type='ethernet'>
and does all openvswitch setup itself. The reason for the latter
is to support running against libvirt versions older than 0.9.11
Rather than require the host admin to figure this out themselves,
the right behaviour can be choosen automatically based on the
libvirt connection's version number.

The LibvirtGenericVIFDriver class can use the 'vif_type' mapping
field to determine whether an OVS network configuration is
required. In combination with a check against the libvirt version
number, a dedicated driver for OVS bridge setup is no longer
required.

The LibvirtOpenVswitchVirtualPortDriver class functionality is
merged into LibvirtGenericVIFDriver. For backwards compatibility
with the Folsom release, the existing LibvirtOpenVswitchVirtualPortDriver
class is made to inherit from LibvirtGenericVIFDriver and directly
call the bridge specific setup APIs. This eases migration to
the new VIF impl during the Grizzly deployment lifecycle, with
an expectation that the LibvirtOpenVswitchVirtualPortDriver stub
will be deleted after the Havana release.

Blueprint: libvirt-vif-driver
Change-Id: I292c2fd7aa0c32b1c91d737152ed8e54ea2cf6ac
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Merge "Change forward_bridge_interface to MultiStrOpt"
Merge "Move security_groups refreshes to conductor"
Access DB as dict not as attributes part 5

Partially implements bp db-api-cleanup
Change-Id: Id34c20701ae0cae503c2218c9a6008d5e0bb0e76
Merge "Cells: Add cells support to instance_usage_audit_log api extension"
Merge "Cells: Add cells support to hypervisors extension"
Merge "Merge Libvirt....VirtualPortDriver class into LibvirtGenericVIFDriver"