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
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
Add host_ip to compute node object

This adds host_ip to the compute_node object as an IPAddress
typed field. The property is already present in the database
and is required to enable use of the compute_node object in
the resource tracker.

This is part of: blueprint make-resource-tracker-use-objects

Change-Id: Id238538a51b5a7a8014fc991def7817959904a95
Catch image and flavor exceptions in _build_and_run_instance

If a user selects a flavor with a disk size that is smaller than
the requested image, a FlavorDiskTooSmall exception is thrown.
However, this exception is not specifically caught in
_build_and_run_instance, but is caught as generic exception,
causing a RescheduledException to be thrown. This forces the
instance to be rescheduled a few times before finally throwing
a NoValidHost exception. It causes confusion because the actual
cause of it is that the disk size is smaller than the requested
image. The following patch properly catches exceptions thrown by
_check_requested_image in _build_and_run_instance.

Change-Id: Ic8b435ba7e8721aa8ca54f29c1ad808833a7608d
Closes-Bug: #1330856
Fix interfaces template for two interfaces and IPv6

If you have more than one interface and IPv6 enabled, then the interfaces file
emitted would have the incorrect syntax: the `auto eth1` line would be
appended to the end of the `gateway` line of the previous stanza.

This was a result of improper whitespace control in the Jinja template which
this patch fixes.

In order to prevent regressions, this patch swaps out the existing tests with
corresponding tests that are whitespace sensitive. This is important because
it's difficult to tweak Jinja templates in a way that fixes the whitespace
for one scenario while not breaking another.

Closes-Bug: 1339888

Change-Id: Id5566ea2f93ee1a6b8bc42e83bc64a1c6a09e680
Updated from global requirements

Change-Id: I4f3e3c81c7595371b9191e79f29f9c40234ed0bd
libvirt: speed up list_instance_uuids method

Switch the list_instance_uuids method to use the new
list_instance_domains method.

Two tests related to list_instance_uuids were removed,
since the earlier tests for the list_instance_domains
method now capture those scenarios.

Blueprint: libvirt-domain-listing-speedup
Change-Id: Ifaa6f7f45b713592e4e45226111442811d753803
Merge "Updated from global requirements"
Merge "Run instance root device determination fix."
Merge "libvirt: speed up list_instance_uuids method"
Merge "Add host_ip to compute node object"
Merge "Improve BlockDeviceMapping object cells awareness"
Merge "Catch image and flavor exceptions in _build_and_run_instance"
Merge "Fix interfaces template for two interfaces and IPv6"