Keep migration status if instance still resizing

There is a race condition during finish_resize() where
poll_unconfirmed_resizes() can get called between the database save
of the migration record and instance record. The migration record
will be marked 'finished', enabling poll_unconfirmed_resizes() to pick
it up. But the instance will not have been saved yet to have the
vm_state of RESIZED, and task_state of None. The task_state will
still be RESIZE_FINISH. This will cause poll_unconfirmed_resizes() to
put the migration record in error state.

Instead, poll_unconfirmed_resizes() should ignore instances with
a task state of RESIZE_FINISH and not put the migration record
into error state.

Change-Id: I825234de5e4a4f0cc906ac05b715ed85cd953aa1
Closes-Bug: #1376933
Separate and refactor affinity filter tests

The unit tests for the scheduler affinity tests were actually *not*
NoDBTestCase tests. In fact, they were relying on the database to create
instance objects instead of just mocking out the call to
nova.compute.api.get_all(). This patch corrects that and separates out
the affinity filter unit tests out of test_host_filters.py.

Change-Id: Ib7268a49e115fbeff7f18c569cecd82b3d3e8cb3
Separate and refactor RAM filter unit tests

The Aggregate RAM filter unit tests were accessing the database to
create Aggregate records. This patch moves all the RAM filter unit tests
out of test_host_filters.py into their own test file and updates the
unit tests to remove any database accesses entirely.

Change-Id: I93399e2af0d230fac9a7f1eb308adfa15e0a84f8
Separate disk filters out from test_host_filters

Simply moves the disk filters out of the test_host_filters.py file and
into their own test file, removing some copy/paste cruft while we're at
it.

Change-Id: I5c83ac1a9fe6c7b6f4019a29d1a5a5847edf1723
Porting baremetal_nodes extension to v2.1/v3

This patch ports baremetal-nodes(include baremetal-stat-ext)
to v2.1 and make v2 and v2.1 share unit test cases.

In v2.1/v3,baremetal-nodes will not depend on baremetal-stat-ext.

Partially implements blueprint v2-on-v3-api
Change-Id: I0f6a968897975ee91e76538d2ce7d2538044613e
Merge "Separate and refactor affinity filter tests"
Merge "Keep migration status if instance still resizing"
Merge "Separate and refactor RAM filter unit tests"
Merge "Separate disk filters out from test_host_filters"
Merge "Porting baremetal_nodes extension to v2.1/v3"