Add debug log for availability zone filter

Sometimes operator need information why the host doesn't pass
the check of scheduler, this patch adds information for available
zone filter if the host doesn't belong to required available zone
and modify the logic a little to make it less nested.

Change-Id: Icb45182fa58d69e7c5e3a77ea31eddc492ac46ec
Partial-Bug: #1301830
Revert "libvirt: add version cap tied to gate CI testing"

This seems like it was really a policy change that should have had
more community discussion.  I think it's appropriate to revert this
now and have this as a full community discussion about options here.

This reverts commit 3bfc25a74e9dfbeb664eecf89d959428713eb178.

Change-Id: Ie19b39e99b223862ca86b9a54c5372b56e1f5d74
Merge BadRequest tests of "get console output" API

In test_console_output, there are BadRequest tests of "get console output".
Most parts of them are duplicated.
This patch merges them for the readability and clarifying their purposes.

Change-Id: Ia83cf1b77a7a185a195286234d7f943d0ca7537f
Log cleanups for nova.network.neutron.api

This patch adds hints for log error and warning levels.

TrivialFix

Change-Id: Ibd516b41cc40afafe2dc37cdc5657d494c33c2cf
libvirt: parse disk backing chains from domain XML

Add support for parsing <backingStore> XML elements in the libvirt
domain XML description for disks.

This is being added to libvirt in order to support blockjob operations
for network-attached disks.

Implements: blueprint libvirt-volume-snap-network-disk

Change-Id: I370c9e8d6a1b1f66e385f009f897816f2e705a36
libvirt: make guestfs methods always return list of tuples

guestfs.GuestFS supports parameter python_return_dict with default
False in 1.22 (backported in 1.20). This indicates that your program
wants to receive Python dicts for methods in the API that return list
of tuples. See http://libguestfs.org/guestfs-release-notes.1.html
In a future version of libguestfs, its default value will be True,
then that will break the code, to avoid this, we'd better force
python_return_dict as False. See http://libguestfs.org/guestfs-python.3.html

This commit makes method inspect_get_mountpoints always return list
of tuples.

Change-Id: I8211cb31a7a890f86cdd818767b3d5e8cfd5bbed
Return 404 instead of 501 for unsupported actions

Change unsupported actions return code to 404 from 501 to ensure
consistency with other unsupported actions in the REST API.

Change-Id: Ibf40ef9108f209b70ffbab6e2387d2d469f7373e
Fix live-migration failure in FC multipath case

Currently, /dev/dm-<NUM> instead of /dev/mapper/<multipath_id> is
used to access multipath FC volumes by Compute Node and
multipath_id in connection_info is not maintained properly and
may be lost during connection refreshing.

This implementation will make source Compute Node and destination
Compute Node fail to disconnect/connect to volumes properly and
result in live-migration failure.

To fix it, /dev/mapper<multipath_id> will be used instead of
/dev/dm-<NUM> to access multipath devices, just like iSCSI multipath
implementation, and logic to preserve the unique (across Compute
Nodes) multipath_id is also added.

Change-Id: I17f15852c098af88afd270084c62eb87693c60d4
Closes-Bug: #1327497
Use v1 as default for cinder_catalog_info

In c5402ef4fc509047d513a715a1c14e9b4ba9674f we recently
added support for the Cinder v2 client. This change modified
the default value of the cinder_catalog_info config such
that an end user who was previously using the Cinder V1
API via the default config setting (by not setting it) would
have a broken Nova -> cinder configuration upon upgrade.

We should hold off on changing the default cinder_catalog_info
for one release to allow for proper deprecation.

Change-Id: I040b2c87ad0a2be92f31264e293794d97c27c965
Closes-bug: #1354499
Backport v3 api unittest into v2 api for attach_interface extension

On most APIs, the unit test coverage of v3 is better than the one of v2.
This patch ports v3 attach_interface API tests to v2 tests for improving
v2 attach_interface API tests

Change-Id: Ie93175602dbced361d76abbe35a7767a96d9e68e
Merge unit tests of "create a flavor" API

In test_flavor_manage, there are success/bad_request tests of
"create a flavor". Most parts of them are duplicated.
This patch merges them for the readability and clarifying their
purposes.

Change-Id: Ic7fa319674594f4470b6eafd3e07e7c467b99477
Use common get_instance function in v2 attach_interface

This patch use common get_instance function in v2 attach_interface.
That can make the instance behavior consistent with v2.1 api. Then
v2.1 and v2 can share same unittest.

Change-Id: Id531377d5d34d76a4ffafaa02ecab585cbcb369b
Consistently use jsonutils instead of specific implementation

jsonutils have several benefits in comparison to pure json
implementation, like enabling C boosted encoders and decoders for
Python2.6 by using simplejson when available.

Change-Id: I24d0cd442e8d9d89fac50e43fc97f7bb4a293c3d
Closes-Bug: 1329496
Added hacking check for jsonutils

jsonutils provides some additional features in comparison to pure json
or simplejson modules. For example, on Python 2.6, it automatically
switches to simplejson that provides significant performance boost.

So let's enforce usage of the module in replacement to stdlib json.

Change-Id: I86ed6cd3316dd4da5e1b10b36a3ddba3739316d3
Drop instance_group_metadata from the database

This completes the instance_group metadataectomy started in the previous
patch. Per recent discussions, this decouples the code change from the
actual schema change, allowing them to (potentially) be run at different
times.

Change-Id: I6c3ff35f6e90fbed8b1fd727eb3b0b0ee140abc4
Resize block device after swap to larger volume

After swap to larger volume, instance's block device should be
resized. Otherwise, the guest can't utilize the extra space.

This patch make the libvirt driver resize block device after mirror
the volume. And add new parameter 'resize_to' to virt driver, that
is used to indicate the new size.

Change-Id: Ib4d65e8812c7d3c28100155124218c75a94e16e7
Closes-Bug: #1341459
Merge "libvirt: parse disk backing chains from domain XML"
Merge "Consistently use jsonutils instead of specific implementation"
Merge "Added hacking check for jsonutils"
Merge "Use v1 as default for cinder_catalog_info"