Comment 2 for bug 1778206

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/587439
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1a29248d5e688ba1d4f806895dccd45fcb34b833
Submitter: Zuul
Branch: master

commit 1a29248d5e688ba1d4f806895dccd45fcb34b833
Author: Matthew Booth <email address hidden>
Date: Tue Jun 26 14:42:47 2018 +0100

    Ensure attachment cleanup on failure in driver.pre_live_migration

    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.

    Change-Id: I67f66e95d69ae6df22e539550a3eac697ea8f5d8
    Closes-bug: 1778206