EC2-API: Fix ambiguous ipAddress/dnsName issue

Currently, the public ipAddress and dnsName take in either the
fixed or floating IP address as a value. The current fix ensures
that the public dnsName and the public ipAddress both get only
the floating ip address. A look into Amazon's EC2 API Reference
tells us that if there is no public IP associated with an instance,
an empty value is returned for <dnsName> and the key <ipAddress>
itself is never returned. This was tested with euca2ools.
Also, the key <publicDnsName> has been removed since it is
the same as <dnsName>

Fixes: bug #1096468

Change-Id: I3b3e3b3f815df41d1976444d33604363e64a7709
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
Make xenapi capabilities['enabled'] use service enabled

filters.compute_filter is enabled by default along with libvirt, but the
capabilities['enabled'] section of it is only supported by XenAPI.
This used to work by adding a parameter to capabilities, but since
the capabilities RPC is being removed, use conductor.service_update to tell
the scheduler which host is disabled.

service_update is already the way to tell the scheduler about other
disabled hosts, so to keep backwards compatibility keep host_enabled but
use service_update underneath.

Part of bp no-compute-fanout-to-scheduler

Change-Id: Ica1919cfe9a2402b2107c557c10d47e01a6c430b
VMware: provide a coherent message to user when viewing console log

The vCenter and ESX returns a PNG format. Currently there is no way
to display a text based format. This at least provides the user with
a message that is informative.

Fixes bug: 1199754

Change-Id: I382219ca89a1574ca233b0f25a89af63af71a22f
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
Add env to make_subprocess

Due to a previous commit, a client of make_subprocess is making a call
with an env parameter. As make_subprocess does not have such a
parameter, image upload fails. This patch adds the env keyword argument
to make_subprocess, and use that in the Popen call.

Fixes bug 1216267

Change-Id: I8098b484067b54c15fe95f2bf84c5890db7ebcb3
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
Merge "EC2-API: Fix ambiguous ipAddress/dnsName issue"
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 "VMware: provide a coherent message to user when viewing console log"
Merge "Stylistic improvement of compute.api.API.update()"
Merge "Move live-migration control flow from scheduler to conductor"