Fixes Hyper-V volume discovery exception message

On some editions of Windows / Hyper-V server the SAN policy is set
by default to "Online All", bringing online any disk, local or shared,
attached to the host.

Since only offline disks can be attached as passthrough disks to a Hyper-V
VM, this prevents Cinder volumes from being attached to instances,
resulting in an exception that can be particularly hard to troubleshoot
without a clear knowledge of the context.

This patch includes some details in the exception message for
troubleshooting purposes.

Change-Id: I6d0b49812f8ca965ca53be34ef009997c8e79728
Closes-Bug: #1361419
downgrade 'No network configured!' to debug log level

Based on the details in bug 1191044, a user can cause the warning
'No network configured!' if they boot an instance in a tenant that
has no neutron networks set up.

Tempest doesn't create a network for every test that creates a nova
instance. The lack of a network is not a sign of something wrong with
nova so a warning log is too much. Move to debug instead.

This should help reduce the amount of warnings that occur on every
tempest run.

Also drop the exclamation mark.

Change-Id: I6bc4e46aa5a72645c72f7232627c7aa9efd2591d
Related-Bug: #1191044
Refactor unit tests for scheduler weights

Remove external depenencies from scheduler weight tests in an attempt
to make the tests cleaner and to only test the weight code itself.

FakeHostState() is used to avoid having to go through host manager and
then mock it's db calls. Additionally, weigher classes are referenced
directly instead of having the weight handler load them first.

Related to blueprint scheduler-optimization

Change-Id: Ifd3577aec6c5fc82e4864623e0545f380fb75b6e
Make scheduler filters/weighers only load once

Right now, filters/weighers are instantiated on every invocation of the
scheduler. This is both time consuming and unnecessary. In cases where
a filter/weigher tries to be smart and store/cache something in between
invocations this actually prohibits that.

This change make base filter/weigher functions take objects instead of
classes and then let schedulers create objects only once and then reuse
them.

This fixes a known bug in trusted_filter that tries to cache things.

Related to blueprint scheduler-optimization

Change-Id: I3174ab7968b51c43c0711033bac5d4bc30938b95
Closes-Bug: #1223450
libvirt: un-cruft _get_guest_numa_config

Several issues get cleaned up with this patch - all of which will make
adding CPU pinning into the mix a lot cleaner.

1) Unecessary context argument to the method is dropped.

2) Secondly - we pass in the InstanceNUMATopology object (or None)
instead of passing in the whole instance and then getting the topology
out - this is useful as we will need instance NUMA for generating topology
as well, and this avoids repetitive code in a lot of places.

3) Add missing tests for updated method the method
get_cpu_numa_config_from_instance

Change-Id: I829465d1612f42e7af92927584b31ca6a2349d5a
libvirt: Fix NUMA memnode assignments to host cells

This fix

  https://review.openstack.org/138128

breaks assignments for NUMA topologies where host cell ID
that the instance cell is pinned to is not in increasing order. The
reason for this is that the main loop of the method that will go through
the host cells (always in ascending order), and find instance cells that
match (may not be in ascending order depending on how the fitting logic
and usage of the host) but we simply append memnodes so they may end up
in the wrong order when we hit the normalization loop.

We fix this by "pre-allocating" the memnodes list and making sure to add
the matching memnode to the same position as the guest config cell
before hitting the normalization loop.

Change-Id: I91055dc705f2ef54c830e641f9cf9ba0683eb313
Closes-bug: #1397381
virt: delete unused 'interface_stats' method

The only use of the virt driver 'interface_stats' method was
removed 3+ years ago by

  commit 07646e85841a4f7c81e80254ac63715bece2aadd
  Author: Brian Waldon <brian.waldon@rackspace.com>
  Date:   Tue Aug 2 10:09:58 2011 -0400

    removing compute monitor

Change-Id: Ie43ebea3ecabd0dd11a5c341bf2310a00f143031
virt: Convert more tests to use instance objects

Update a couple of methods in test_virt_drivers so that they
use instance objects instead of dicts

Blueprint: libvirt-driver-class-refactor
Change-Id: Ib2257ac97c533a8a0d7f45994d21a67d08444e19
libvirt: Convert more tests to use instance objects

Convert a bunch more test cases over to use objects.Instance
instead of a dict()

Blueprint: libvirt-driver-class-refactor
Change-Id: I4f34c9c795f99e56dd6ca27be237e8c2252f782e
Only check db/api.py for session in arguments

We were checking both db/api.py and db/sqlalchemy/api.py for session
in db apis, but db apis are only defined externall in db/api.py. This
rule will falsely match on non-api methods in db/sqlalchemy/api.py
which take a session argument. Passing the session around within this
module is considered a good thing.

Change-Id: Ibf5d1284b44013c736b6b70ca4fa5d706c365c7d
Updated from global requirements

Change-Id: I0d572918d958bcff6ab15af9ccea09401e53ebac
Replace stubs with mocks

This change updates the test cases for volume encryptors to use mocks
rather than stubs. The impetus for this change is comments on another
change (https://review.openstack.org/#/c/124791) that request new
tests to be written using mock. Mixing stubs and mocks would be
confusing so this change removes the existing stubs entirely.

Change-Id: I99ff78edcae5eaccabf4ea4caf04b8406ffa2f80
Merge "Refactor unit tests for scheduler weights"
Merge "Make scheduler filters/weighers only load once"
Merge "libvirt: un-cruft _get_guest_numa_config"
Merge "libvirt: Fix NUMA memnode assignments to host cells"
Fix base obj_make_compatible() handling ListOfObjectsField

This makes the base class' obj_make_compatible() handle lists of
objects properly.

Related to blueprint kilo-objects

Change-Id: Iaff1b435819e9aefcd2b362c846c87f9efa3f618
Make objects use the generalized backport scheme

This makes the objects that have subobjects use the base class'
obj_make_compatible() implementation for backports.

Related to blueprint kilo-objects

Change-Id: I106cd57001f028de7cc8ce7c7024809bceaed020
fix import of oslo.concurrency

It's now oslo_concurrency, and importing the old symbol triggers a
deprecation warning. There were 2 instances of this unfixed.

Change-Id: Ib63da2d845843410634a1df0261af33b973daf32
Merge "Fix base obj_make_compatible() handling ListOfObjectsField"