Make nbd reservation thread-safe

Avoid the situation where two local threads choose the same nbd number
for injecting files into the instance. If this happened quickly enough
nova was left with one qemu-nbd hanging and blocking the device forever.

Fixes bug 1207422

Change-Id: I18864b19ebd30669534e45ca7a50e12f61207302
Link Service.compute_node with ComputeNode object

This is the third in a three-step dance to implement a Service
object, a ComputeNode object, and finish the relationship with
the circular reference from Service to ComputeNode. It adds
Service.compute_node, a nested object relationship that is either
lazy-loaded on access, or pre-loaded if a database query
includes it. This should exactly match the behavior of the
SQLAlchemy objects that we have now.

Note that this requires a new DB API method to look up a
ComputeNode object from its service_id. This was previously
provided by the SQLAlchemy relationship between the two objects.

Related to blueprint compute-api-objects

Change-Id: If62d443e34a3c8ce9bc83008fc69821494686bc7
Stylistic improvement of compute.api.API.update()

The previous implementation of compute.api.API.update() method included
a line of code where the '_' identifier was used to hold a throw-away
variable. Such a usage of underscores is generally not a good style and,
more importantly, it can possibly lead to a name conflict with the '_'
function imported as 'from nova.openstack.common.gettextutils import _'
in several modules of the system.

The present patch fixes the above, as well as some indent issues in the code.

Change-Id: I7a904109f4809fd677ded06b7eea3205c38a369b
Update availability_zone on time if it was changed

The problem is that when the availability_zones for one host
aggregation was updated, the VM attribute of availability_zones
which belong to the host in the availability_zones was
not updated on time.

If updated values include availability_zones, then the cache
which stored availability_zones and host need to be reset.

Fix bug 1203250

Change-Id: Ib3f08fbe3c74d5aa101da78faed43b0bc03cb988
Imported Translations from Transifex

Change-Id: Ie00b44f5712ed1af796f6b13471162956bcf314e
Remove unused nova.common module

It seems like the common is unused. I an wondering what jenkins will say.

Change-Id: I55366dc30e46b09d19124dbe821a115999bf7395
use 'exc_info=True' instead of import traceback

We need store traceback message in log sometime. Python logging module
already provide a argument to do that. For example, we could:

logger.error('msg', exc_info=True) # log current exc_info
logger.debug(e, exc_info=(type_,value_,tb)) # log exc_info passed in arg
logger.exception('msg') # exception add exc_info automaticly

There're many places using traceback, but only two places are using
traceback for loging exc_info. (some use to store into variable, some in
openstack/common leave this to oslo)

Change-Id: I96eff1e7a0437c358753e636a8a6ac860074cb25
Fix v3 extensions inherit from wrong controller

Extensions keypairs and config_drive's controller should
inherit from nova.api.openstack.wsgi.Controller. Inherit
from wrong controller may cause strange errors.

Partially implements bp v3-api-extension-versioning

Change-Id: I5e2a588960bf6b1c0afafb89ecaab255dbd2a1f4
Move live-migration control flow from scheduler to conductor

This builds on previous patches that moved code to
the conductor and adding the conductor into the control path.

We take care to ensure this works with a local conductor, but
running the code in a greenlet thread, but this will work best
when conductor is run as a standalone service.

The next steps are to move more logic from the compute manager
into the conductor, then to start supporting dealing with
tasks that get stopped half way though execution.

Part of blueprint live-migration-to-conductor
Change-Id: I4120156db1499dfd3ed22095e528787eb73d33a6
VMware: remove redundant default=None for config options

The value removed was redundant.

Change-Id: I8da1708bc45ea6a07e24f4025c2a0ebf13fd21d0
Pci Device DB support

Add a new table to store information about available PCI devices on
compute nodes and related APIs to fetch and update these devices
information.

Add a summary PCI device column to compute node table so that
scheduler doesn't need joinload to get the PCI information.

Co-authored-by: Boris Pavlovic <boris@pavlovic.me>

bp:pci-passthrough-base

Change-Id:I9ca8fe689a7ef1c4f22dec8640a018c0adff773c
Add PCI device object support

To support PCI passthrough, we keep all assignable PCI device information
in the database. Two objects are provided to access the pci devices.
PciDevice represents one specific PCI device on a compute node, and
PciDeviceList represents a list of pci devices.

A resource tracker on each compute node manages the PciDevice objects,
keeping track of their status and instance allocation.

bp:pci-passthrough-base

Change-Id: Ib69cc448277dc197331556c622fb77937009f276
Signed-off-by: Yongli He <yongli.he@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Merge "Stylistic improvement of compute.api.API.update()"
Merge "Move live-migration control flow from scheduler to conductor"
Merge "Make nbd reservation thread-safe"
Merge "Pci Device DB support"
Merge "Add PCI device object support"
Merge "Fix v3 extensions inherit from wrong controller"
Merge "Link Service.compute_node with ComputeNode object"
Merge "Imported Translations from Transifex"