libvirt: Fix _cleanup_resize

Undefine domain and unplug vifs in _cleanup_resize if the instance was
migrated to another host.

Fixes bug 1015731

Change-Id: If6eb1ada029d462777bbd6ea113c98c3b801cf5d
Zmq register opts fix in receiver

Following dprince's change to use
FLAGS, rather than cfg.CONF,
zmq_opts needs to be registered explicitly.

Change-Id: I66bc71563435088ee9224fdd603602e35f3e3bff
Updated code to update attach_time of a volume while detaching

While detaching volume from an instance, attach_time of the
volume is not updated. This task updates volume['attach_time']
to NONE at detach_volume.

Also modified the default value of XML attribute
volume['attach_time'] '-' to ''(a 0 length string) to
maintain consistency with existing code.

Fixes bug: 1056122

Change-Id: If56ceda6caab80fb803fcf194ed1dfb18808ec3a
Num instances scheduler filter

Allow for scheduler filtering based on number of instances already assigned to
that host.

FLAGS.max_instances_per_host controls the maximum number of instances allowed
per host.

Change-Id: Id3e8973311ea5ac8db2d9e4e594a5288a9e3f94d
Remove deprecated Folsom code: config convert

Removes config file converter: nova-manage config convert

Change-Id: I146bff9ac00a4885e7054f999ae52159da3f86ef
Add nova-cert service to integrated_helpers

This allows us to do integration tests that need to use nova-cert.
Note that creating a certs for every test seems a bit excessive,
so this adds a fake_crypto module to return fake values.

Change-Id: Ia92c1dde8b122aef096004e9aad0a14ee587bbf0
Add api samples to Certificates extension

Change-Id: Ifb61c9cd90f03225c27b5683e5f54f30c636994c
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 "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>