Fixes a race condition on updating security group rules

During creating the instance, compute manager makes an rpc call
to "allocate_for_instance" from the network manager, which will
in turn end up making a rpc cast to each compute_manager with
an instance in the group(s) than need to be refreshed calling
refresh_instance_security_rules.

When an instance is being created is in a group that has a
rule referring to itself, that chain will end up trying to
refresh the rules for the instance which is still being created.

That call will find its way down to do_refresh_instance_rules()
in libvirt/firewall - which will in turn try to get network_info
from the global "network_infos" in firewall.

But the entry in network_infos for this instance might not of
been added yet, as that only happens when the create of the
instance calls "prepare_instance_filter which comes later in
the sequence as part of driver.spawn

The fix here adds a synchronisation lock to the incomming
refresh call so that it is blocked until any in-progress
thread on the instance is finished.

Change-Id: I550e286aa4777b011633550109e18e03d63a4bbb
Fix script argument parsing.

The vm_vdi_cleaner.py script's argument parsing was broken and unloved.

Change-Id: I1662534d65fd0e8472e092ed9f10d6cc059f1cab
Add image to request_spec during resize

Image is needed by ImagePropertiesFilter during scheduling.

Resolves bug 1117882.

Change-Id: Icfbba85e2fdeb609d5fdabb6a7c3167505fe23b0
Add libvirt XML schema support for resource tuning parameters

Extend the libvirt XML config classes to support for CPU, disk IO,
network traffic tuning parameters.

Blueprint: quota-instance-resource
DocImpact
original reviews https://review.openstack.org/#/c/14151/

Change-Id: I2827ea0e731fefe5bbaec6c385268a3f5b89f7f6
Add support for instance vif traffic control.

Part 2 for blueprint quota-instance-resource, by adding exposed params
"vif_inbound_average, vif_inbound_burst, vif_inbound_peak,
vif_outbound_average, vif_outbound_burst, vif_outbound_peak" through
nova flavor-set, user can implement instance net traffic control policy.
for example:
nova flavor-set m1.medium set vif_inbound_average=10240000,
then the max inbound speed is 10MB/s. The usecase details of other params
will be noted on openstack-manuals.

Partly implement blueprint quota-instance-resource
DocImpact
original reviews https://review.openstack.org/#/c/14151/

Change-Id: I9934daadbf0e136e88530f5c23b556d070395bd0
remove intermediate libvirt downloaded images

* nova/virt/images.py (fetch_to_raw): When converting a downloaded
image to raw, ensure we delete the original download image.
I.E. the .part file.  The regression was introduced in 7c265343.
* nova/tests/test_libvirt.py (test_fetch_raw_image): A new test
for this function which wasn't tested previously.

Fixes bug: 1125068
Change-Id: Ie6f2cff1a554b8500fd66f0832566ae1b317be40
Imported Translations from Transifex

Change-Id: I1016d574022230b3fdfd6ae580a657aeb45bb1a0
Merge "Imported Translations from Transifex"
Add and check data functions for test_migrations 141

Before the 141 migration test is run, _prerun_141 populates the migrations
table with a generated uuid. The _check_141 function checks that
the uuid migrated properly down to 36 char.

Partially implements: blueprint migration-testing-with-data

Change-Id: I43b47f69a94720bf9487eb30576035493700ddca
Add select_hosts to scheduler manager rpc

This adds a select_hosts(...) method to the scheduler manager
rpc that allows other services to query it for the best suited
host instead of relying on it to proxy its messages.

This can be used by extensions that need the scheduler to determine
the best-fit host but want to prepare and send their own messages
to that host.

Change-Id: I5b4760114dfcdb0464fac8ea81f46f7532ac0580
Enable multipath for libvirt iSCSI Volume Driver

Implements: blueprint libvirt-volume-multipath-iscsi

nova/virt/libvirt/volume.py:LibvirtISCSIVolumeDriver can now
make use of multipath (behavior defined by use_multipath flag)
runs a scsi inquiry to the storage vendor (iSCSI portal)
asking for more portals, logins to the discovered portals and uses a
multipath device (/dev/mapper/XX) instead of a singlepath device
(/dev/disk/by-path/ip-IP:PORT-iscsi-IQN-lun-X).

This improves IO speed and robustness, since if one iSCSI portal goes
down, there are still others to take care of IO.

Change-Id: I30489234b8329f576cf2cbb0ef390670dbee5b95
Merge "Fix script argument parsing."
Fix hacking tests on osx

There were a few incompatibilities with the hacking tests and
OSX. Readlink -f doesn't work so use cd and pwd instead. Importing
a module with path separators doesn't work, so recursively import
the module. Finally the extra / in the find command was not needed.

Add a 'set -e' to run_pep8 to make sure test fails on any error

Ignore paste as it doesn't have an __init__ in its top level directory

Change-Id: Ifc66da7b872faa08f3be98f8b10486181ba77861
Merge "Enable multipath for libvirt iSCSI Volume Driver"
Do not use abbreviated config group names (zookeeper)

Using abbreviated config group names just makes the config file harder
to understand, so just use full name.

zk => zookeeper

Change-Id: Ia8b3ff9201365477003535600e419540deae7341
Small spelling fix in sqlalchemy utils.

Change-Id: Iabc7c3d6a3cee6496b19811ad29b336a63cd0529
Live migration with an auto selection of dest

Add ability to let scheduler decide on target host during live migration.

Implements: blueprint live-migration-scheduling
Change-Id: Id596fa3a0ef2b1b5faf854e4b4557b3c4b413e39
Merge "remove intermediate libvirt downloaded images"
Merge "Add libvirt XML schema support for resource tuning parameters"
Merge "Add image to request_spec during resize"