Previously, if the call to driver.pre_live_migration failed (which in
libvirt can happen with a DestinationDiskExists exception), the
compute manager wouldn't rollback/cleanup volume attachments, leading
to corrupt volume attachment information, and, depending on the
backend, the instance being unable to access its volume. This patch
moves the driver.pre_live_migration call inside the existing
try/except, allowing the compute manager to properly rollback/cleanup
volume attachments.
The compute manager has its own _rollback_live_migration() cleanup in
case the pre_live_migration() RPC call to the destination fails. There
should be no conflicts between the cleanup in that and the new volume
cleanup in the except block. The remove_volume_connection() ->
driver_detach() -> detach_volume() call catches the InstanceNotFound
exception and warns about the instance disappearing (it was never
really on the destination in the first place). The attachment_delete()
in _rollback_live_migration() is contingent on there being an
old_vol_attachment in migrate_data, which there isn't because
pre_live_migration() raised instead of returning.
Conflicts in nova/compute/manager.py due to absence of setting
migrate_data.wait_for_vif_plug from 5aadff75c3.
Change-Id: I67f66e95d69ae6df22e539550a3eac697ea8f5d8
Closes-bug: 1778206
(cherry picked from commit 1a29248d5e)
(cherry picked from commit 6aecf475db)