use REDIRECT to forward local metadata request

VMs can not get metadata when metadata_host is set to 127.0.0.1 because
packet's destination address will be changed into 127.0.0.1 by iptables.
However, linux kernel will reject packets to 127.0.0.0/8 if packets do not
come from that range. We can use REDIRECT to resolve this problem because
REDIRECT will rewrite the destination address to our own host.

Fixes bug 1015853.

Change-Id: I162fc57510ef9c8e84130b2d11eb53e10dcc5cb0
Adds Hyper-V support in nova-compute (with new network_info model), including unit tests

blueprint hyper-v-revival

Features included in ths commit:

Spawn (including CoW image option support)
Destroy
Info
List
Pause
Unpause
Suspend
Resume
Reboot
Power On
Power Off
Snapshot
Volume Attach
Volume Detach
Boot from Volume
Live Migration

Supported platforms:

Windows Server / Hyper-V Server 2008 R2
Windows Server / Hyper-V Server 2012

Unit tests:

Unit tests for all the listed features are included.
Tests can be execute on Linux as well.

nova.conf relevant flags:

Compute driver:

compute_driver=nova.virt.hyperv.driver.HyperVDriver

External vswitch to be used:

vswitch_name=an_external_vswitch

Path where the VHDs are going to be stored

instances_path=C:\Hyper-V\instances

Live migration support for hosts with etherogeneus CPUs

limit_cpu_features=true

Change-Id: Ic40adcd2d78b0ca6792d77940810f5a44de8cc37
Always create the run_instance records locally

Currently a request for multiple instances issent to the scheduler,
where it is written to the database. It appears that this was done so
that more advanced schedulers could handle the request as one
batch, but the result is the scheduler is sometimes slow enough
that the call will timeout.

Instead this converts to always creating the instance records
locally and making run_instance into a casting instead of a call.

This made a small change to the rpc api for run instance, so the
version was bumped. Legacy messages are still handled properly.

Fixes bug 1036911

Co-authored-by: Chris Behrens <cbehrens@codestud.com>

Change-Id: I63bbc98c285faebec53f8e62857c01548807db68
Merge "Adds Hyper-V support in nova-compute (with new network_info model), including unit tests"
Remove unused variables

'dialect' is unused in some functions.

Change-Id: Ibc02251f596a87776f16938ff422606b6ca49876
Merge "Always create the run_instance records locally"
xenapi: attach root disk during rescue before boot

Fixes bug 1037729

The xenapi driver attaches the root disk after the rescue instance has
booted. However, hotplugging block devices is only supported on images
that use PV drivers. Attaching the disk before the rescue instance boots
will allow rescue to work on instances that don't use PV drivers.

Change-Id: I187762e4f1ea921d81afd40fcbde0b93d7d3cbc1
Merge "use REDIRECT to forward local metadata request"
Merge "xenapi: attach root disk during rescue before boot"
Implement GET (show) in OS API keypairs extension.

Includes test for showing a keypair (existing and non-existing).

This commit also corrects the name of the KeyPairNotFound exception
in the test_keypair_delete_not_found test case.

Additionally some extra print statements in the tests were
removed.

DocImpact - need to add documentation for GET on: v2/{tenant_id}/os-keypairs/{keypair_name}

Fixes LP Bug #925731.

Change-Id: I9eeb47ccb9bf352c554aa44aa562c47e3eb33cae