Fixes spawn issue on Hyper-V

The current Hyper-V Technical Preview introduces slight changes
in the data returned by GetVirtualHardDiskSettingData in
Msvm_ImageManagementService.

Co-Authored-By: Adelina Tuvenie <atuvenie@cloudbasesolutions.com>
Change-Id: I830b07efb657acc1486f86a475310f5f4e584a37
Closes-Bug: #1376883
Clean the test cases for service plugins

Make HTTPRequestV3 to HTTPRequest in test_services functions.

Partially implements blueprint v2-on-v3-api

Change-Id: I8e96060051f1ef3e037602007a2bf127f9b334ee
Add API validation schema for services v2.1 plugin

This patch adds API validation schema for 'services' plugin
for V2.1.

Partially implements blueprint v2-on-v3-api

Change-Id: Ife11459bf53e097b0bd21e008785a5222eff0092
Load extension 2 times fix load sequence issue

Some extensions such as volumes need to inherit servers, however
the extension load sequence can't be guaranted. If the servers
extension is loaded after volumes, the controller of volumes will
be None and lead to problem.

Change-Id: Iec1e759f5c1f570a6b0ac65fb357b4f15102499c
Closes-Bug: #1373238
Clean up in test_server_diagnostics unit test case

This patch changes V3 router to V21 router,
and HTTPRequestV3 to HTTPRequest. which can be shared between
V21 and V2

Partially implements blueprint v2-on-v3-api
Change-Id: Id3c91c377b9ba98c5cf2d1d2b4f476cec3159792
Use HTTPRequest instead of HTTPRequestV3 for v2/v2.1 tests

This patch replace HTTPRequestV3 with HTTPRequest for
test_shelve unit test case, which can be shared between
v2 and v21

Partially implements blueprint v2-on-v3-api
Change-Id: I732335e1f4885a067e42c48c75417ba0b4aba192
Error code for creating duplicate floating_ip_bulk

Trying to create a floating_ip_bulk that already
exists gives HttpBadRequest error, but it should
raise HttpConflict as the user is conflicting the
already created floating_ip_bulk.
So updated the code to HttpConflict error.
Closes-Bug: #1374260

Change-Id: I8194f08e6f8d1922b7316d302837549b5c957ba9
Fix instance_update() passing SQLA objects to send_update()

In a previous commit, the notifications plumbing was made to expect an
instance object in some places. The legacy instance_update() method was
still passing DB objects to that method, causing a failure to actually
emit the notification.

Change-Id: Idafed020668f013182fab5c3f6829aedf20edaed
Closes-Bug: #1396324
VMware: fix exception when multiple compute nodes are running

A number of operations in the VMwareVCDriver class first validate
that instances node is the cluster that is mapped to the compute
node. This is problematic when the compute nodes have different
configurations, for example, each compute node is mapped to a
different cluster.

In this case many operations that are just performing instance operations
will fail. This patch ensure that all instance operations that do not
require a cluster or volume will make use of the base _vmops class.
This is due to the fact that it only requires the instance details
to interface with the VC and there are no specific cluster operations.

Change-Id: I2bc38a480f2feb12ea41e7d28f80b29dd49a79b8
Closes-bug: #1345460
Check server group policy on migrate/evacuate

This patch changes server group checking in the instance group setup.
Previously, it checked for the presence of the 'group' scheduler hint
as an indication that the instance was a member of a group.  However,
that hint is only present on initial boot.  It is not present when the
scheduler is being used to pick a destination for a migration or
evactuate.

The updated logic checks the database to see if the instance is a
member of a group.  For performance reasons, it only does this is
server group functionality is enabled in the scheduler (group filters
are enabled).

This change makes it so server group policy enforcement will still
occur for migrations and evactuations, instead of only on first boot.

It also adds the call to setup_instance_group in evacuate, resize,
cold migrate and live migrate methods because now it is possible to
access the group setup.

Implements blueprint anti-affinity-on-migration

Closes-bug: #1379451

Change-Id: I6e9ea6ba69e8658fa5126a3488ee12cf2437460c
Fix use of extract_flavor() in hyper-v driver

This converts a use of extract_flavor() in the hyper-v driver to
instance.get_flavor().

Related to blueprint flavor-from-sysmeta-to-blob

Change-Id: I91d568e6eb97965bd4f406d0c0f047011ec50b78
Make metadata server use Instance.get_flavor()

This removes the use of extract_flavor() from the metadata server.

Related to blueprint flavor-from-sysmeta-to-blob

Change-Id: I06373f02a693d5fa9ad5acfe4e268a5fdbd5bac8
Make network/* use Instance.get_flavor()

This makes the nova-network and neutron API modules use the
get_flavor() helper to avoid dependence on flavors being in
system_metadata.

Related to blueprint flavors-from-sysmeta-to-blob

Change-Id: I11033a755e577031773bf01634f020455844e625
Merge "VMware: fix exception when multiple compute nodes are running"
Merge "Fix use of extract_flavor() in hyper-v driver"
Fix use of conf_fixture

As the name implies, conf_fixture.ConfFixture is a fixture. It should
be used by calling self.useFixture() instead of calling it directly.
This ensures that the setUp() method is called correctly.

If the test classes are executed individually, the database config
options are not registered correctly and could result in this failure
for each test case:

NoSuchOptError: no such option in group database: backend

Closes-bug: 1396703

Change-Id: Iaf7e1aedaacf24508e55f4d6975946f83ef833a6
Merge "Make metadata server use Instance.get_flavor()"
Merge "Make network/* use Instance.get_flavor()"
move the integrated tests into the functional tree

This moves the integrated tests into the functional tree as an initial
seed for the functional tests. It was agreed to as an early step at
the design summit. Work on cleaning these up will happen after the
move.

PYTHON_HASH_SEED=0 is needed because these tests apparently remain
order dependent.

Also remove the use of test.ReplaceModule, which is an untested
mocking system in the nova tree that doesn't seem to reliably
work. Use stubs instead for the time being, as this will ensure
repeatability of the code.

Part of bp:functional-tests-for-nova

Change-Id: I742c487dd7bca9de3e811c545de477367fff112c
Merge "move the integrated tests into the functional tree"