compute: Take an instance.uuid lock when rebooting
Previously simultaneous requests to reboot and delete an instance could
race as only the latter took a lock against the uuid of the instance.
With the Libvirt driver this race could potentially result in attempts
being made to reconnect previously disconnected volumes on the host.
Depending on the volume backend being used this could then result in
stale block devices point to unmapped volumes being left on the host
that in turn could cause failures later on when connecting newly mapped
volumes.
This change avoids this race by ensuring any request to reboot an
instance takes an instance.uuid lock within the compute manager,
serialising requests to reboot and then delete the instance.
Closes-Bug: #1838392
Change-Id: Ieb59de10c63bb067f92ec054535766cdd722dae2
(cherry picked from commit 9ad54f3dacbd372271f441baea5380f913072dde)
(cherry picked from commit 939cd9b177db8f12952e72145a5c00a0574959eb)
Reviewed: https:/ /review. opendev. org/696152 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=304d3f62a4e 3bdbaab6fe7dd66 5174bc5b696d08
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit 304d3f62a4e3bdb aab6fe7dd665174 bc5b696d08
Author: Lee Yarwood <email address hidden>
Date: Mon Jul 29 16:25:45 2019 +0100
compute: Take an instance.uuid lock when rebooting
Previously simultaneous requests to reboot and delete an instance could
race as only the latter took a lock against the uuid of the instance.
With the Libvirt driver this race could potentially result in attempts
being made to reconnect previously disconnected volumes on the host.
Depending on the volume backend being used this could then result in
stale block devices point to unmapped volumes being left on the host
that in turn could cause failures later on when connecting newly mapped
volumes.
This change avoids this race by ensuring any request to reboot an
instance takes an instance.uuid lock within the compute manager,
serialising requests to reboot and then delete the instance.
Closes-Bug: #1838392 67f92ec05453576 6cdd722dae2 271f441baea5380 f913072dde) 2952e72145a5c00 a0574959eb)
Change-Id: Ieb59de10c63bb0
(cherry picked from commit 9ad54f3dacbd372
(cherry picked from commit 939cd9b177db8f1