Rename instance_type to flavor in test_utils and nova.tests.utils

Renames occurrences of 'instance_type' to 'flavor' in
nova.tests.test_utils and nova.tests.utils along with any impacted tests
using the changed parts.

Part of blueprint flavor-instance-type-dedup

Change-Id: Ie816356c176c2be61b4a346a4d47d8f3461ae84a
Prevent spoofing instance_id from neutron to nova

Previously, one could update a port's device_id in neutron to be
that of another tenant's instance_id and then be able to retrieve
that instance's metadata. This patch prevents this from occurring by
checking that X-Tenant-ID received from the metadata request matches
the tenant_id in the nova database.

DocImpact - This patch is dependent on another patch in neutron
            which adds X-Tenant-ID to the request. Therefore to
            minimize downtime one should upgrade Neutron first (then
            restart neutron-metadata-agent) and lastly update nova.

Change-Id: I93bf662797c3986324ca2099b403833c2e990fb4
Closes-Bug: #1235450
Pass Instance object to compute vnc rpc api

Pass a real Instance object to the get_vnc_console() method of the
compute rpc api.  The object_compat() decorator is used to provide
backwards compatibility with receiving data in the old format.

Change-Id: Ib615fd653e0ef6196241fde81f541b1e18eb3ced
Send Instance object to validate_console_port

Update the validate_console_port() method of the compute rpc api to take
in an Instance object instead of a dict.  The object_compat() decorator
is used to ensure the change is backwards compatible, and that the code
will still work if it receives an instance in dict format.

Change-Id: Ief8fabc8490315acb41bf85ad421683fea31daf9
Pass Instance object to console output virt driver api

Update the get_console_output() method of the virt driver API to be
defined to accept an Instance object.  While we're at it, pass the
context, as well.

Change-Id: If325a39f6314cff936e604fcc5816deefbb1199b
Merge "Prevent spoofing instance_id from neutron to nova"
Merge "Pass Instance object to compute vnc rpc api"
Merge "Rename instance_type to flavor in test_utils and nova.tests.utils"
Merge "Send Instance object to validate_console_port"
Merge "Pass Instance object to console output virt driver api"