Change prep_resize paths to use objects

Converts calls to compute's prep_resize to pass a new-world instance
object.

This does not convert the scheduler prep_resize method which is still
called on reschedules.  It will soon be deprecated anyway.

Related to blueprint unified-object-model

Change-Id: I7a150f119547595aec962d5e5a8d2ab815d0b6c5
Adding VIF Driver to support Mellanox Plugin

blueprint mellanox-vif-driver

DocImpact

Change-Id: Ic98db496a3e175c9dee98657609a66934c41d557
Make compute_api use Service and ComputeNode objects

This converts compute_api (and associated nova-api and test code)
to use Service and ComputeNode objects for their work.

Note the removal of the nova.db import from compute/api.py.
There is still a chunk of code that uses self.db, but it's
progress.

Related to blueprint compute-api-objects

Change-Id: I7d0b4c0d02559ec16b35dd38278cdf738e0fda6c
Avoid swallowing exceptions in network manager

In _allocate_fixed_ips() and setup_networks_on_host(), we spawn off
green threads to call _rpc_allocate_fixed_ip() and
rpc_setup_network_on_host() on remote network managers, but if there is
an exception in the thread it just gets swallowed.

We don't really need a GreenPool here. It's not like its limit of 1000
threads is relevant here. Just use eventlet.spawn(), collect the list of
threads spawned and call wait() on each of them. This will ensure the
exception gets raised by wait().

Also, fix a case in the v3 integrated servers test where we are setting
up fake networks which are associated with a non-existent 'fake-mini'
host. See also I9854863bbec8834c638c55832411f63da570f82d.

blueprint: oslo-messaging
Change-Id: I7af1c4c1869edf3601809fe02fb82b12c8b70811
Add PCI device filters support

Cloud administrator may decide the devices that can be assigned to VM
based on vendor_id or device_id etc.

This is whitelist based filter. No device will be assigned
except explicitly defined.

The configuration option 'pci_passthrough_whitelist' can be defined multi
times, each for one type of device.

bp:pci-passthrough-base

Change-Id: I03f2a0c098198a32abedff0773e9f94e3d7d2f28
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Yongli He <yongli.he@intel.com>
PCI device auto discover

Hypervisor discovers and returns information about assignable PCI devices
as xml resource. PCI auto discover provoid method to convert these to a
dict. PCI tracker will transform the information into pci device object
store it into the DataBase.

bp:pci-passthrough-base

Change-Id: I6241053668a430f573d23dc862d812259c004dfd
Signed-off-by: Yongli He <yongli.he@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Merge "Add volume snapshot APIs to driver interface"
Merge "Add db.block_device_mapping_get_by_id"
Merge "Introduce Invalid* EC2 error codes"
PCI devices resource tracker

PCI device need to be scheduled according the resource status. The PCI
tracker provoides central contorl of the PCI resouces.

Discovered PCI devices are passed to the PCI tracker to track their status,
and to provide functions for compute node components to update, check, claim
the PCI devices resources.

PCI Tracker also updates PCI stats which provide infomation to the scheduler.

bp:pci-passthrough-base

Change-Id: Ia80633b5a52b88fd7c9aea168644283b00be0b49
Signed-off-by: Yongli He <yongli.he@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Add PCI device tracker to compute resource tracker

PCI device tracker manages all the PCI devices life cycle.

The resource tracker on a compute node uses the PCI device tracker's
interface to query for resources, claim PCI devices, and alloc and
free PCI devices for instances.

bp:pci-passthrough-base

Change-Id: I766d7f92e26fb75c1d6095dc0237c44f938d4170
Signed-off-by: Yongli He <yongli.he@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Tenant id filter test is not correct

The test_tenant_id_filter_converts_to_project_id_for_admin is not testing what
it is reporting.
To test that the tenant_id filter is actually mapped correctly to the
project_id filter, the request has to include the all_tenants options too.

That should be make clearer how the tenant_id option actually works.

Change-Id: Id6e8c9d2f39d4dd7ce3bb60400d9cf52c9133f48
xenapi: agent not inject ssh-key if cloud-init

It is possible to have an image with both the xenapi agent and
cloud-init present, or an alternative agent that makes use of metadata
to configure a server.

To ensure the agent will not clash with the ssh key and file injection
of the agent, I have added image properties so we can disable these
agent operations on a per image basis.

The image properties this new code looks for are:
xenapi_skip_agent_inject_ssh=true
xenapi_skip_agent_inject_files_at_boot=true

DocImpact
Part of blueprint xenapi-guest-agent-cloud-init-interop
Change-Id: I416ade49663208769571fe0c9cf22c8fc1360244
powervm: Use FixedIntervalLoopingCall for polling LPAR status

This patch moves the code in stop_lpar that polls the LPAR status for
'Not Activated' to it's own helper method that uses
FixedIntervalLoopingCall with an eventlet timeout.

Also moves the hard-coded timeout to the constants file.

Builds on top of change Iad64dda79f46d18c7aa5bee12ed41e7a01853d34 to
verify the new looping call and timeout code works with the
test_stop_lpar_timeout test case in that patch.

Change-Id: I59586d3cb242d40ee5e09e48274de11cb5638717
Merge "Fix HTTP response for PortInUse during boot (v3 API)"
Merge "Avoid swallowing exceptions in network manager"
Adds support for security_groups for V3 API server create

Adds support for specifying the security group during the V3 API
server create to the security groups extensions. This was
accidentally missed during the initial port. Adds the
corresponding XML deserialization and unittests.

Partially implements blueprint nova-v3-api
Fixes bug #1208746

Change-Id: Ie9d9e03ae20357212b0f270d97a19a0d0f9b0557
Adds V3 API samples for agents, aggregates and certificates

Adds v3 API samples for the agents, aggregates, and certificates
extensions. Bundling them together to save on review load

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: Iee26fe25b5fd369f2a1f5690ddc095a90526a549
Merge "Removes fixed ips extension from V3 API"
Assisted snapshots compute API plumbing

This patch adds the plumbing necessary to get assisted volume snapshot
calls down from compute.api down to a compute host.

Part of blueprint qemu-assisted-snapshots

Change-Id: I18d89b16c3e4bbbb2cdf3fe70c958f7e671e78ec