Make rbd.libvirt_info parent class compatible

Rbd.libvirt_info function definition misses hypervisor_version argument added in change:
https://review.openstack.org/32379

Closes-Bug: #1233188
Change-Id: Ib68d743e783af0f6d82d2ba180869ee642e86050
(cherry picked from commit 7a34be0ec0cd0cb9555fe64ff6c486faae1ae91d)
Retry reservation commit and rollback on deadlock

Reservations can deadlock when concurrent commits are run from
multiple hosts on the same project. This fixes the issue by using
our convienient retry on deadlock feature.

Change-Id: I31d74f4267eaa33e798de926069d1a0f63006a59
Closes-bug: #1274341
(cherry picked from commit 9c556d1557a7056d6056b25d3b91ff4abcb97971)
Remove reduntant call to update_instance_info_cache

get_instance_nw_info calls _get_instance_nw_info,
which is decorated with @refresh_cache. This in
turn calls update_instance_info_cache, again. This
is both expensive and more importantly dangerous because
the method update_instance_info_cache may call
_get_instance_nw_info itself, thus causing an infinite
loop.

Change-Id: Id8f0241d1c6609cf4e064ee6855228ae7de250e2
Partial-bug: 1235435
(cherry picked from commit 651fac3d5d250d42e640c3ac113084bf0d2fa3b4)
Remove unneeded call to conductor in network interface

The following patch removes an unneeded call to conductor to retrieve
data already available in instance.

Note: six.text_type() was added and wrapped around info_cache in some of
the tests. This was done because values from the db are in unicode
(text_type). The reason the test changed is because previously we
did not check the type of string from what the conductor was returning.

Closes-bug: #1258360

Conflicts:

	nova/tests/network/test_neutronv2.py

Change-Id: I45a24af11534911be68fd0964b79fdf726d88de6
(cherry picked from commit 10004672ad1476c55deaad53684a50358da6f656)
Enable compute_node_update to tolerate deadlocks

When running the CI there were cases when the aformentioned method would
throw a DBDeadlock exception.

Change-Id: I98d1a804c51e1bf3bb96193d82ffe7e5d064e134
Closes-bug: #1253455
Merge "Retry reservation commit and rollback on deadlock" into stable/havana
Merge "Remove reduntant call to update_instance_info_cache" into stable/havana
Merge "Remove unneeded call to conductor in network interface" into stable/havana
VMware: fix image snapshot with attached volume

A snapshot of a instance with an attached volume will result in
the wrong volume being uploaded to glance. The reason for this
are as follows:
1. the last image in the list of images would be exported
2. the base image would not be exported but the first found

The same happens with a VM rescue if there is a cinder volume
attached.

The solution is to search for an image that contains the instance
UUID.

Change-Id: Ic85b0ffd4f1c34f10d07b1a198eaad2030803d6f
Closes-bug: #1243193
(cherry picked from commit 9ceee09594cd35c264cab3e3b3d1d80aaa3fdbc4)

Conflicts:

	nova/virt/vmwareapi/vm_util.py
	nova/virt/vmwareapi/vmops.py

Change-Id: I6b9febbfe4e4e6ecf5d31a2b09a4319b07696f9c
VMware: fix bug for exceptions thrown in _wait_for_task

If the _call_method fails, for example a resource is not found,
then the same call will be invoked again due to the fact that the
polling task was not stopped.

Closes-Bug: #1246848

Change-Id: If4818e41aed5be03395ab22afc0edf9abb3c34e1
(cherry picked from commit 1c1570ff7ac8470d7dba28c893300835b22e0966)
Fixed a problem in iSCSI multipath

Multipathing for attach volume and detach volume operations
doesn't work properly if there are different targets
associated with different portals for a mulitpath device.

Closes-Bug: #1266051
(cherry picked from commit 429ac4dedd617f8c1f7c88dd8ece6b7d2f2accd0)

Conflicts:
	nova/tests/virt/libvirt/test_libvirt_volume.py
	nova/virt/libvirt/volume.py

Change-Id: Iab316526cf64de60325d90043f73fa3e83fafb4e
Fix InstanceNotFound error in _delete_instance_files

Currently the cleanup_running_deleted_instances peroidic task
failed with InstanceNotFound exception, this is because the
db query is not including the deleted instance while
_delete_instance_files() in libvirt driver.

Closes-bug: #1280140

Change-Id: Ie65ff255ad3c582a71db93b07304a21d4976a193
(cherry picked from d835163759527a651f3c4f2109ca0fdc3e968d37)
VMWare: bug fix for Vim exception handling

The exception handling in the Vim module was too broad and did not treat
the suds.MethodNotFound exception. This would result in a exception
that "__deepcopy__" is not supported in the VIM module.

In the case of an exception the VMwareAPISession class may be deleted.
The patch also ensures that the deletion is able to logout if necessary.

Closes-bug: #1228847

(cherry picked from commit be5d39eacc84c11f96357a624ffa1cdeda8a568d)

Conflicts:

	nova/tests/virt/vmwareapi/test_vmwareapi.py

Change-Id: Ic85be9b3407c444db4b3a074108c01d9141c61be
Merge "Enable compute_node_update to tolerate deadlocks" into stable/havana
Correct the state for PAUSED instances on reboot

If an instance is in the PAUSED state before the compute node is
restarted, it will be left in an inconsistent state (impossible to
delete and/or restart it) after the node boots again.

This patch adds a check in the periodic task sync_power_state so when
this situation is detected the instance is stopped and left in a state
from where it can be started again or deleted.

Closes-Bug: #1265494
Change-Id: I7266ace596598522c28a3839091ef50faf4463c2
(cherry picked from commit 6abda5b738c5d801ede3328cf0ec1dc9dddc022f)
Merge "VMWare: bug fix for Vim exception handling" into stable/havana
Merge "Correct the state for PAUSED instances on reboot" into stable/havana
Merge "Fixed a problem in iSCSI multipath" into stable/havana
Merge "Fix InstanceNotFound error in _delete_instance_files" into stable/havana
Merge "VMware: fix image snapshot with attached volume" into stable/havana