Add flavor-manage to core for V3 API

Adds the flavor-manage plugin to the core list for the V3 API.
This is part of the process of adding all of the flavor related
extensions to core, with the exception of rxtx, as per the discussion
here: https://etherpad.openstack.org/p/NovaV3APICore

Partially implements blueprint nova-v3-api

DocImpact

Change-Id: Idbedce5cc5936abc52235cd40573c8fe841f24fe
Nova-all: Replace basestring by six for python3 compatability

The builtin basestring abstract type was removed in python3,
use str instead, we need to using six.string_types to replace
the basestring for py3 compatibility.

Partial Implements bp: basestring-py3-compatible

Change-Id: I17e87e49e7ebf3cc9c391e9beace8c45d2d2b689
Drop auth_token configs for api-paste.ini.

We now prefer to use nova.conf to configure keystoneclients
auth_token configs.

Also, Devstack has now been update to allow this:

  https://review.openstack.org/#/c/52258/

Change-Id: I2a4b300af37eddf5010b97ca796f0552941642a8
Fix interface-attach removes existing interfaces from db

The following commit 394c693e359ed4f19cc2f7d975b1f9ee5500b7f6 changed
allocate_port_for_instance() to only return the ports that were created
rather than all of the ports on the instance which broke the attach-interface
code.

This patch fixes this issue by remove the sync decorators from:
allocate_for_instance, allocate_port_for_instance, and
deallocate_port_for_instance to just _build_instance_nw_info which
is called in all these cases instead.

Closes-bug: #1223859

Change-Id: I66eb0c0ab926e0a8d1e2c9cfe1f7fd579ea3aa27
Remove unnecessary steps for cold snapshots

Up until now when we created cold snapshots we were stopping the
instance, create an internal snapshot, extract the snapshot to a file
and then delete the internal snapshot before bringing up the instance.

If the instance is shut down, there's no concurrent writer, so the image
can be directly extracted without taking an internal snapshot first,
because the snapshot and the current state are the same.

In this patch the creation and deletion of the internal snapshot are
removed to eliminate the extra steps and optimize the creation of
snapshots a bit.

Closes-Bug: #1242819
Closes-Bug: #1247185

Change-Id: I429fa2e1e26aea321eecbf14edd11263fff525ae
domainEventRegisterAny called too often

Changeid I090765802bfe443440f16722bc7c43b6280fe56a fixes
bug #1240905 but introduced a bug whereby domainEventRegisterAny
is called on every call to _get_connection.

Change-Id: Ifafc6a4c172b1521d62988ccbb3a2f51a95e323f
Fixes: bug #1250135
Remove dup of LibvirtISCSIVolumeDriver in LibvirtISERVolumeDriver

LibvirtISERVolumeDriver is an almost copy of
LibvirtISCSIVolumeDriver.

Change-Id: I7f71be69df6dc203508114fc67f55b7da2b0e529
VMware: Detach volume should not delete vmdk

During volume detach a delete_virtual_disk_spec is used to remove
the device from the running instance. This spec also "destroy" the
underlying vmdk file, this is not right, we should not delete vmdk
file when detach it from a VM instance.

The fix was remove the fileOperation field when detach vmdk volume
so as to make sure the volume will not be destroyed; but for iscsi
we still need to destroy the volume.

Also I changed the function name from delete_virtual_disk_spec to
detach_virtual_disk_spec which is more accurate.

Change-Id: Ibd218d6a8cfeede4f5ca74f28bc0c3d0c185bb14
Closes-Bug: #1241350
Removed unused methods from db.api

Since 406ff304bb09f144a59448e0e9d2d01160c7d553 reservation methods
is not called directly so it can be removed from the public API

Related to blueprint db-cleanup

Change-Id: I5a62d0528705b6773f8667375b4e8e3922a1bd15
Merge "Removed unused methods from db.api"
Xenapi: Allow windows builds with xentools 6.1 and 6.2

Building a windows VM with pre-installed xentools
6.1 or 6.2 requires device_id to be set on XEN VM record.

Requires xenapi_device_id to be set on the
image metadata, which is then used to set the device_id
on the vm record.

DocImpact

Implements: blueprint allow-windows-builds-with-xentools6-1-and-6-2
Change-Id: Id3cd9d569519f2df1afa046ddabf33f00d63c615
Rename virtapi.instance_type_get to flavor_get

Renames the virtapi.instance_type_get method to flavor_get. Updates the
directly related tests and subclass implementations of VirtAPI.

This patch does not propagate to all related code like conductor API,
that will be handled in a later patch for the blueprint.

Part of bp flavor-instance-type-dedup

Change-Id: Ic47da9aa578d449a4ce542d2d017840f1a8132a7
Merge "Xenapi: Allow windows builds with xentools 6.1 and 6.2"
More instance_type -> flavor renames in db.api

Renames the instance_type methods in db.api to flavor and converts the
tests to match. Updates doc strings where needed.

Note that this patch doesn't rename anything touching the db models for
instance types, that will be handled in a later patch for the blueprint.

Part of bp flavor-instance-type-dedup

Change-Id: I397421c9b34d295368999c5d085345409945151a
Cache Neutron Client for Admin Scenarios

Store a thread local copy of Neutron client for use with admin
tokens, this will prevent excessive calls to keystone to mint
new tokens and will enable reuse of the already set up client
for subsequent calls in this thread.

Change-Id: I6346281ca3516c31b195ce71942786d724e5e9df
Closes-Bug: #1250580
Merge "Fix interface-attach removes existing interfaces from db"
replace assertNotEquals with assertNotEqual

assertNotEquals will be deprecated in Python 3.

This is part of blueprint assertequal

Closes loose ends with assertEquals.

Change-Id: I5cd5c8ceb8b0232f1218d6f445d230c8747ac327
Merge "Remove dup of LibvirtISCSIVolumeDriver in LibvirtISERVolumeDriver"
Merge "Remove unnecessary steps for cold snapshots"
Merge "domainEventRegisterAny called too often"