Fixes Hyper-V dynamic memory issue with vNUMA

vNUMA and dynamic memory are mutually exclusive, so the former
needs to be disabled for instances where dynamic memory is enabled.

Change-Id: Ic730c294ffc89925076688a44adf2594c7f6712b
Closes-Bug: #1305897
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
fixed typo in test name

Change-Id: I751c288122215c7a9ffafd3f9f4c61a321b23dab
Remove useless join in nova.virt.vmwareapi.vm_util

This change replaces in nova.virt.vmwareapi.vm_util the pattern
''.join(['fo...o'], ['b...ar']) by the pattern 'fo...ob...ar' which
avoids runtime string concatenation.

Change-Id: If23d8377acde2c3419b67ca11b03a1c898561c77
Remove duplicate test

Remove a test case that is a duplicate of what is done by
test_group_details_in_filter_properties.

Change-Id: I6a6c0b3f9474ca82be05e7ff5d47908a9093b119
Related-bug: #1379451
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
Port fixed_ip extention to v2.1

This patch ports fixed_ip extention from v2 to v2.1,
and have v2 unit test cases shared between v2.1 and v2.

Partially implements blueprint v2-on-v3-api
Change-Id: Ifa7e0dd5a91cfe881077b92aeb7019d0435d780a
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
VMware: rename vmware_images to images

There is no need for the prefix vmware. vmware_images.py has been
renamed to images.py and test_vmware_images.py has been renamed
to test_images.py.

Change-Id: Icbc64da072f60713c1a79aca2ed503dcd7586063
VMware: delete the driver VMwareESXDriver

In Juno we had a deprcation warning about the VMwareESXDriver no
longer being supported. This class is now deleted.

Change-Id: Id5b50fa944f57cd8fd61611d93caac8066cfd93d
Console: delete code for VMRCConsole and VMRCSessionConsole

In Juno there was warning that this code will be removed in Kilo.
This patch deletes the VMRC console classes for the ESX and VC drivers.
This code has not worked since the Icehouse release.

Change-Id: If2d1e237f92eb080dadc2eee1f2f2771a06ce2f6
libvirt: treat suspend instance as an object

The suspend method receives an object in the compute manager. This
method now uses an object in the driver.

Change-Id: Iccbb70553259aa914303d4d48583644b50a2f142
libvirt: use instance object for resume_state_on_host_boot

The compute manager uses a instance object here. Add support to the
driver.

Change-Id: I6f81a62bcc95f7616414a102f1c470bb621b7bca
libvirt: use instance object for attach_volume

The compute manager uses a instance object here. Add support to the
driver.

Change-Id: I32bc269ce392f1e41f0ddb88b912a5a4bfb7bad8
libvirt: use instance object for detach_volume

The compute manager uses a instance object here. Add support to the
driver.

Change-Id: If257885b4345e3abd72ca20c59e2210affcbc62d
Translate 'powervm' hypervisor_type to 'phyp' for scheduling

This adds a temporary translation of the 'powervm' hypervisor type
image metadata to 'phyp' for scheduling.

The powervc-driver in stackforge uses the hypervisor type of 'powervm'
for scheduling so this is needed to make that work until the driver
can get a translation shim in place to convert powervm to phyp in
image metadata.

Closes-Bug: #1370613

Change-Id: I4b20ffcb9911806db821f2902e09248dfa89d845
Cleanup of tenant network tests

Moves tenant network tests out of test_network.py
into test_tenant_networks.py which already has
tenant network tests and merges the test classes

Change-Id: I59cc3ec93432b26386943ac8922a7e2fc240ce30
Make pci_requests a proper field on Instance object

When we added the pci_requests object, we didn't plumb it all the way into the
Instance object because of time constraints. This finishes that work so that it
behaves properly and doesn't require an additional DB lookup every time we need to
pull it based on an instance.

Partial-Bug: #1368260
Change-Id: I134441c8288d5dbdc0bac6163cb2affc9f0af762