compute: Lock by instance.uuid lock during swap_volume
The libvirt driver is currently the only virt driver implementing swap
volume within Nova. While libvirt itself does support moving between
multiple volumes attached to the same instance at the same time the
current logic within the libvirt driver makes a call to
virDomainGetXMLDesc that fails if there are active block jobs against
any disk attached to the domain.
This change simply uses an instance.uuid based lock in the compute layer
to serialise requests to swap_volume to avoid this from being possible.
Reviewed: https:/ /review. opendev. org/754695 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=6cf449bdd0d 4beb95cf12311e7 d2f8669e625fac
Committed: https:/
Submitter: Zuul
Branch: master
commit 6cf449bdd0d4beb 95cf12311e7d2f8 669e625fac
Author: Lee Yarwood <email address hidden>
Date: Mon Sep 28 12:18:29 2020 +0100
compute: Lock by instance.uuid lock during swap_volume
The libvirt driver is currently the only virt driver implementing swap tXMLDesc that fails if there are active block jobs against
volume within Nova. While libvirt itself does support moving between
multiple volumes attached to the same instance at the same time the
current logic within the libvirt driver makes a call to
virDomainGe
any disk attached to the domain.
This change simply uses an instance.uuid based lock in the compute layer
to serialise requests to swap_volume to avoid this from being possible.
Closes-Bug: #1896621 47f1ffddb4edbb5 03bf490504c
Change-Id: Ic5ce2580e7638a