libvirt: Always disconnect_volume after rebase failures
Previously failures when rebasing onto a new volume would leave the
volume connected to the compute host. For some volume backends such as
iSCSI the subsequent call to terminate_connection would then result in
leftover devices remaining on the host.
This change simply catches any error associated with the rebase and
ensures that disconnect_volume is called for the new volume prior to
terminate_connection finally being called.
NOTE(lyarwood): Conflict caused by MIN_LIBVIRT_VERSION being 1.2.1 in
stable/ocata making I81c32bbea0f04ca876f2078ef2ae0e1975473584
unsuitable. The is_job_complete polling loop removed by that change in
master is now moved into the try block of this change ensuring we catch
any errors that might be thrown while waiting for the async pivot. The
log.exception message also requires translation in Ocata.
Conflicts: nova/virt/libvirt/driver.py
Change-Id: I5997000a0ba6341c4987405cdc0760c3b471bd59
Closes-bug: #1685185
(cherry picked from commit 809065485c19fd535db6740bb21b867c41c008fe)
(cherry picked from commit fbcf8d673342570a1518dbf8d88f289c2c39cd30)
Reviewed: https:/ /review. openstack. org/460482 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=8fb411c9b2a f9bb5fef3cc2725 17c54bab821cd4
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 8fb411c9b2af9bb 5fef3cc272517c5 4bab821cd4
Author: Lee Yarwood <email address hidden>
Date: Thu Apr 20 19:43:32 2017 +0100
libvirt: Always disconnect_volume after rebase failures
Previously failures when rebasing onto a new volume would leave the connection would then result in
volume connected to the compute host. For some volume backends such as
iSCSI the subsequent call to terminate_
leftover devices remaining on the host.
This change simply catches any error associated with the rebase and connection finally being called.
ensures that disconnect_volume is called for the new volume prior to
terminate_
NOTE(lyarwood): Conflict caused by MIN_LIBVIRT_VERSION being 1.2.1 in a876f2078ef2ae0 e1975473584
stable/ocata making I81c32bbea0f04c
unsuitable. The is_job_complete polling loop removed by that change in
master is now moved into the try block of this change ensuring we catch
any errors that might be thrown while waiting for the async pivot. The
log.exception message also requires translation in Ocata.
Conflicts:
nova/ virt/libvirt/ driver. py
Change-Id: I5997000a0ba634 1c4987405cdc076 0c3b471bd59 35db6740bb21b86 7c41c008fe) a1518dbf8d88f28 9c2c39cd30)
Closes-bug: #1685185
(cherry picked from commit 809065485c19fd5
(cherry picked from commit fbcf8d673342570