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
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
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
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
Fix a typo in two comments.  networksa -> networks

Change-Id: I925fbf55f9a52d3866693b32f138e1b09efbbad8
create new cidr type for data storage

it turns out that the 149 migration was overly agressive in its
IPAddress conversion, as we actually have a few columns that are
really CIDR values. This means that 39 chars isn't enough space to
store even a normalized IPv6 cidr in the worst case (you need 4
more to support /127).

We must also normalize IPv6 address cidrs otherwise 43 chars isn't
long enough. This was more of a problem in theory, than in practice,
as real IPv6 addresses rarely are non compressible.

This adds a migration to bump up the CIDR columns to 43 characters.
There is an infinitessimal chance that someone using mysql and long
IPv6 values might loose data in 149 because of truncation. This
doesn't address that, which would require modifying 149.

The native pg CIDR column type is not used because it would require
additional scrubbing of the data as CIDR is invalid if any host bits
are set (and it will fail on type conversion).

Fixes bug #1127696

Change-Id: I54539ac9c257d726bc4db5943169b5284cc847d3
Merge "Fixes a race condition on updating security group rules"
Merge "Small spelling fix in sqlalchemy utils."
Merge "Do not use abbreviated config group names (zookeeper)"
Merge "Add select_hosts to scheduler manager rpc"
Merge "Live migration with an auto selection of dest"
Merge "Add support for instance vif traffic control."
Merge "create new cidr type for data storage"
Merge "Fix a typo in two comments.  networksa -> networks"