Return proper error messages while associating floating IP

Handled the FloatingIpNotFoundForAddress, NotAuthorized exceptions
raised while associating floating IPs which are not allocated
or allocated to another project.

Fixes bug 1057906

Change-Id: I2d6eba9159b4e855fe615ed4dfa23c388d28c6d0
powervm: exception handling improvements

PowerVMLPARInstanceNotFound should extend InstanceNotFound so nova
can handle it as an InstanceNotFound when LPARs are missing
Small bug fix so cleanup failing due to LPARs not existing does
not cause the delete to fail out, since we had nothing to cleanup

fixes bug #1061173

Change-Id: I3b26a477e55b4627f401dbb25c66d5e84ab1fa3f
Add ability to download images via BitTorrent.

This patch adds a new dom0 plugin which supports downloading images via
BitTorrent. Torrent metadata files are assumed to be served from a
webserver which is specified by the `torrent_base_url` config.

Under the hood, the dom0 plugins calls out to rasterbar's libtorrent via
Python bindings in order perform the initial download as well as the
seeding thereafter.

Implements BP xenserver-bittorrent-images

Change-Id: I824720a6e3a37317080a22cd7405d2a88172c3ef
powervm: remove broken instance filtering

Filtering isn't necessary (nor desired in some cases)
Irrelevant comment cleanup

fixes bug #1061291

Change-Id: I0798ff20aea7551b1d1100e8a439c39be99291e1
xenapi: Refactor snapshots during resize

Currently, we use VM.snapshot for resize, which fails if we have a
volume attached to the VM, which does not support snapshots. This change
uses VDI.snapshot instead, for all VDIs that are not attached by nova.

Also needed for xenapi: detaching and reattaching volumes during
migrations and reverting of migrations.

Fixes Bug #1028092

Change-Id: I3e2973747135a9c33de194e38537620c397bb87e
libvirt: ignore deleted domain while get block dev

The get_all_block_devices could raise libvirtError if domain was deleted
while listing instances. This will cause LibvirtISCSIVolumeDriver to fail
disconnect_volume. This patch ignores the domain that could not be found
to avoid this issue.

Fixes bug 1060836

Change-Id: I9dc994d8ca7fc084830adb4f6f9d3ca10e0fe577
Merge "ip_protocol for ec2 security groups"
Merge "Remove deprecated Folsom code: config convert"
Stop network.api import on network import

The nova.network.__init__.py was importing the network.api
automatically at import time. This was leading to some silly
workarounds (for example in nova/virt/firewall.py) involving
late importing nova.network to stop circular imports.

It is also causing issues with https://review.openstack.org/#/c/13007/
because quantum api needs to import a flag from network manager
which is causing a circular import.

This fixes the issue by moving to use the code from volume_api
which only imports the api class when the method is called. It cleans
up the tests that were stubbing out network.API and also removes
the unneeded workarounds.

Change-Id: I4c9b372d078ab4398e797335a8de5e9e1077e31f
Merge "Add ability to download images via BitTorrent."
Merge "Zmq register opts fix in receiver"
Merge "Stop network.api import on network import"
Merge "Updated code to update attach_time of a volume while detaching"
Merge "libvirt: ignore deleted domain while get block dev"
Fix XML response for return_reservation_id.

The XML serializer for create uses the server template for it's response.
However, when return_reservation_id is set, only a reservation_id is
going to be returned.

To enable the XML response to be serialized the reservation id is now
returned in a server tag/object.

This commit fixes bug 1061124

Change-Id: Ic74071b1d527c3f3752e296d3fd46a28a99beb76
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
Merge "powervm: exception handling improvements"
Set read_deleted='yes' for instance_id_mappings.

Since the migration that creates the instance_id_mappings does
not populated the 'deleted' column, queries to this table should
not limit results to 'deleted=0'.  Limiting to non-deleted rows
results in duplicate mappings being created for existing instance
mappings after an upgrade, and throws off the entire EC2 instance
ID to UUID mapping.

Fixes LP: #1061166

Change-Id: I8893954fcae94a71dcc284c1b3b23b53901437eb
Move snapshot image property inheritance

The xenapi snapshotting code had support for inheriting properties
from the base image of the snapshot (by way of the system metadata
set on the snapshotted instance).  The problem, however, came in the
fact that some image properties were set in nova.compute.api, but
those properties were not excluded from this inheritance logic
except through a configuration option called
"non_inheritable_image_properties".  I had previously updated the
default setting for this option to work around the bugs introduced
by setting image properties in two different locations, but now it
is time for the real fix.

This change moves the inheritance logic into
nova.compute.api:API._create_image.  Note that two properties are
still set through the xenapi snapshotting logic: the "os_type" and
the "auto_disk_config" properties, which are presumed to be xenapi
specific.  The change also alters the inheritance logic to ensure
that the work-around listing of image properties in
non_inheritable_image_properties is no longer necessary; the
default for this configuration option is updated accordingly.

(Note: It will not harm anything to have these image properties
still listed in non_inheritable_image_properties, so configurations
that override this option do not need to be altered.)

Change-Id: I3514da432cc10c75418e1de9752f60640d579136
Merge "powervm: remove broken instance filtering"
Merge "Add nova-cert service to integrated_helpers"