Replace custom patching in `setUp` on HypervisorsSampleJsonTests

It would be better if we get rid of `setUp` method in 
`HypervisorsSampleJsonTests` in which happens 
patching and replace it on class-mock.

Change-Id: If3758564c4febf2019ecdb4fce972580a562f759
Remove uncessary instance.save in nova compute

Adjust the code path to remove an uncessary instance.save
function to make the boot performance better.

Change-Id: I9e9ac85912f026b2953c7b283dd51a704a52164c
host manager: Log the host generating the warning

Currently we are logging a warning when there's a discrepancy between
the host's available disk stored in the database and the disk reported
by the compute node, but there's no information about which host
generates that error.

Change-Id: I8d6704fa76f2750e0e986b8399f9fe358b3fad93
VMware: use instance.uuid instead of instance['uuid']

Uses an instance object for deletion, port attach and detach.
These methods now receive an instance object instead of a dict.

TrivialFix

Change-Id: I1092d32f5144baac6dfdc919f5e827533c67e6d6
Remove param check for backup type on v2.1 API

The backup type is only used by glance, so nova check it make
no sense; currently we have daily and weekly as only valid param
but someone may add 'monthly' as param. nova should allow it
and delegate the error. This patch removes check on v2.1 API.

Change-Id: I59bbc0f589c8c280eb8cd87aa279898fffaeab7a
Closes-Bug: #1361490
Make test_host_filters a NoDBTestCase

This is the final patch in the refactoring series. This changes the
test_host_filters.py file to contain just the test of the filter handler
system and cleans up the previously database-creating TestHostFilters
class.

The entire set of host filter unit tests (around 350 of them) now run in
less than 2 seconds, down from over a 45 seconds on my workstation.

Change-Id: I2f2518a08ac3f8c6addcd4055ee4c706c4c92e8e
Move setup_instance_group to conductor

During prework of scheduler split, we identified that
there is a call from setup_instance_group to the Nova object
InstanceGroup. That prevents the scheduler to be split as a
separate project because it would have an external dependency to
a Nova object.
The implementation here is providing the call by the conductor
before the call to select_destinations as this method only
modifies filter_properties for adding group details.

Co-Authored-By: Ed Leafe <ed@leafe.com>

Change-Id: Ib6556c8f6d6e6dcdb65a0bdb1894c66e92b35230
Use oslo.middleware

Remove outdated code and replace its usages by usages of oslo.middleware
library

Sync latest request_id middleware from oslo-incubator(only to allow
grenade jobs pass)

4ffc4c8 Add middleware.request_id shim for Kilo
4504e4f Remove middleware

Co-Authored-By: Abhishek Chanda <abhishek@cloudscaling.com>
Co-Authored-By: Davanum Srinivas <dims@linux.vnet.ibm.com>

Change-Id: I89ef3df1b8d3b2c6e391d04e89e35f2ee974a3cc
Use sizelimit from oslo.middleware

Module sizelimit in nova and oslo.middleware is the same, so
switch nova to use RequestBodySizalimiter from oslo.middleware
lib

Replace RequestBodySizalimiter and LimitingReader by temporal
aliases of this classes in oslo.middleware due to failures in grenade
jobs. Remove tests for this module

Change-Id: I6296215857c2b16035c9081e13ac4345ed5c420a
Merge "VMware: use instance.uuid instead of instance['uuid']"
Merge "host manager: Log the host generating the warning"
Merge "Remove uncessary instance.save in nova compute"
Merge "Remove param check for backup type on v2.1 API"
Merge "Use oslo.middleware"
Merge "Use sizelimit from oslo.middleware"
Merge "Replace custom patching in `setUp` on HypervisorsSampleJsonTests"
Merge "Move setup_instance_group to conductor"
Merge "Make test_host_filters a NoDBTestCase"
Refactor unit tests for scheduler weights

This change simplifies tests by making use of FakeHostState() to avoid
having to go through host manager and to mock it's db calls.

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.

Change-Id: I3174ab7968b51c43c0711033bac5d4bc30938b95
Closes-Bug: #1223450