Run instance root device determination fix.

Legacy bdm in incoming parameters contains a number of devices
specified by their names (e.g. "vdb" or "/dev/vdc").
Current code considers "vda" as root device and doesn't work on
"/dev/vda", for example.
This fix extracts the last significant character (digits
are skipped in "..sda1")  from the name like "a", "b", "c" and
selects the root device by checking for "a".

Change-Id: Iebaa117bb747d30ac9ceabd8805740dec9d1355c
Closes-Bug: #1322180
Move oslotest to test only requirements

oslotest is only used for unit testing, so
it shouldn't be in requirements.txt

Change-Id: I5073fbd93712072cec8598663590e35fc2edd08d
Replace assert* with more suitable asserts in tests

The following replacements were done in unit tests to
 have clearer messages in case of failure:
- assertTrue(a == b or a == c) with assertIn(a, [b, c])
- assertTrue(type(a) == dict) with assertIsInstance(a, dict)
- assertTrue(type(a) == int) with assertIsInstance(a, int)

Also assertTrue with several conditions was splitted.

Change-Id: Id6e5db9ead8d8dceb9f416c1b55280855d25e604
Replace assertTrue/False with assertEqual/NotEqual

The following replacements were done in tests to have
clearer messages in case of failure:
- assertTrue(* == *) with assertEqual
- assertTrue(* != *) with assertNotEqual
- assertFalse(* == *) with assertNotEqual

Change-Id: Idbb1a292cf8545b87728fa2b815c67f923ef6efa
libvirt: Support snapshot creation via libgfapi

Currently, the libvirt driver only handles volume snapshot
creation for file-backed volumes.

This changes allows volume snapshot creation for libgfapi-
attached volumes to work.  (A sufficiently new version of
libvirt is required.)

Implements: blueprint libvirt-volume-snap-network-disk
Closes-Bug: 1288976

Change-Id: Ic6dd861b40b692b25df67c9d5b63fd436c690fde
api: remove unused function

Change-Id: I2ef2711d2ceffd3a3c375a137ff07f9ad0e18aeb
Clean conntrack records when removing floating ip

Established connections via floating ip won't get disconnected after
disassociating.
This patch move clean_conntrack from migration code to remove_floating_ip to
make sure that established connections on floating ip will get interrupted
immediately after disassociating.

Change-Id: I88d258ea39ea7c76e4cc60a636eb1e3e6aaa6f22
Closes-Bug: #1334938
Use mtu setting from table instead of flag

Adds mtu to argument lists of key methods and configuration of vlan
interface. Also adds deprecation notice to the "help" info for the file
based network_device_mtu configuration property.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: Ia401eb95ce8c81d104e59b0348e3474655b9a992
sync periodic_task fix from incubator

Set the value of time the periodic task was last run to a multiple of the
spacing value rather than the actual last time run. This ensures tasks runs
regularly but avoids synchronizing that interval with other nodes.

This patch also removes the coalescing of tasks which are _nearby_ (0.2
seconds away).

4dbd3aa Make periodic tasks run on regular spacing interval
21249f1 Fix parenthesis typo misunderstanding in periodic_task

Change-Id: I8873545578f104fd204fbc25493350128b2bc8d4
Object-ify APIv2 agents extension

This makes the APIv2 agents extension use the Agent object instead
of direct database access.

Related to blueprint compute-manager-objects-juno

Change-Id: I79d68be5d14c8af0f96164608f6c535530ef6d5e
Object-ify APIv3 agents extension

This converts the APIv3 agents extension to use the Agent object
instead of direct-to-database queries.

Related to blueprint compute-manager-objects-juno

Change-Id: I780c96bc32e7d457f8af73d941894b7d3ba08d98
Improve BlockDeviceMapping object cells awareness

This patch makes BlockDeviceMapping object methods that are creating and
updating the database more aware of the cells. There are 2 changes that
are good to distinguish between:

 - create() will _never_ work in the API cell and will raise an
   ObjectActionError.
 - save() and destroy() are now aware in which cell they are being
   called and do not attempt to propagate it upwards

This is currently a no-op change as we don not currently use objects in
any of the code that will run in the top cell. This is in fact
preparation for transiting the API code to using BlockDeviceMapping
objects.

Change-Id: Ic5806c844f2deab734011d68f5da316903000f67
Resolve import dependency in consoleauth service

If you attempt to access an instance's noVNC console on the
horizon dashboard, an AttributeError is thrown, complaining
about 'module' object having no attribute 'InstanceInfoCache'.
This is because the objects are not registered by the consoleauth
service. This patch fixes this import dependency by registering
all objects so it could be used by the consoleauth service.

Change-Id: I4f9b922a077076b156833590762106d5cd2ad276
Closes-Bug: #1337447
Fix duplicate definitions of variables/methods

Found these with a static analysis tool. Removed a bad
cut-n-paste of 2 test methods. Changed test method names
slightly to ensure they run

Change-Id: I15a90d0447e8038683a36766138d8db088cb4136
Remove duplicate keys from dictionaries

Found using a static analysis tool. Removed the duplicate key/value
pair as it was unnecessary.

Change-Id: Iab6374031c2af65d66c9d54fcb68c3a94603d43b
libvirt: more efficient method to list domains on host

The current libvirt driver code uses the legacy APIs for
enumerating domains on a host. These have a number of
problems

 - O(N) APIs calls are required to list N domains which
   is slow as number of domains increases
 - Race wrt start/stop of guests gives many problems
     - Domains guest lost between listDomainsIDs() and
       listDefinedDomains()
     - Domains disappear before lookupById/Name is
       called
     - Disagreement between numOfDomains and listDomainsIDs
       and numOfDefinedDomains and listDefinedDomains

Blueprint: libvirt-domain-listing-speedup
Change-Id: Id31f3071dfb10e33c51501b860a03f8975bbe812
Remove duplicate python-pip from Fedora devref setup doc

This just removes the duplicate python-pip from the list
of packages to install via yum when setting up a development
environment on Fedora/RHEL.

Change-Id: I3bd0aa7230c29a97845d744f6522bd2ffd1bf130
VMware: virt rescue method now supports objects

Commit a37a96fd13b933123e80ad24e37fc37d73c16059 ensured
that the compute API and manager are now getting objects
for the rescue method.

This patch adds support to the virt driver code.

Change-Id: Id7fca437f8470ee483ec3683211766095b293ebf
VMware: virt unrescue method now supports objects

Commit 65ad230af5ece020822fa963dd30fd641a54ae91 ensured
that the compute API and manager are now getting objects
for the unrescue method.

This patch adds support to the virt driver code.

Change-Id: I42fa532d5b2b1c92121216ac31b56a7b595d59e7
Add aggregates.rst to devref index

aggregates.rst was the only devref document that wasn't included in any
toctree.

Change-Id: I3e4392d2571b954d4553ca8e50b02053db4b5d99