Save updated libvirt domain XML after swapping volume
When a user calls the volume-update API, we swap_volume in the libvirt
driver from the old volume attachment to the new volume attachment.
Currently, we're saving the domain XML with the old configuration prior
to updating the volume and upon a soft-reboot request, it results in an
error:
and falls back to a hard reboot, which is like pulling the power cord,
possibly resulting in file system inconsistencies.
This changes to saving the new, updated domain XML after the volume
swap.
Closes-Bug: #1713857
NOTE(melwitt): The assert in test_swap_volume_block_old_libvirt had to
be modified to account for the additional XMLDesc call from the bug
fix. The test_swap_volume_block_old_libvirt doesn't exist in Pike, so
that's why we didn't hit this in the master patch.
Change-Id: I166cde5ad8b00699e4ec02609f0d7b69236d855d
(cherry picked from commit 5b008c6540f948d28dc50a0ef84095ebd96d198d)
Reviewed: https:/ /review. openstack. org/523911 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=aa0e4ebd2c0 2c042bbe2c0d58e 690e3e43b04a17
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit aa0e4ebd2c02c04 2bbe2c0d58e690e 3e43b04a17
Author: melanie witt <email address hidden>
Date: Tue Aug 29 22:53:44 2017 +0000
Save updated libvirt domain XML after swapping volume
When a user calls the volume-update API, we swap_volume in the libvirt
driver from the old volume attachment to the new volume attachment.
Currently, we're saving the domain XML with the old configuration prior
to updating the volume and upon a soft-reboot request, it results in an
error:
Instance soft reboot failed: Cannot access storage file <old path>
and falls back to a hard reboot, which is like pulling the power cord,
possibly resulting in file system inconsistencies.
This changes to saving the new, updated domain XML after the volume
swap.
Closes-Bug: #1713857
NOTE(melwitt): The assert in test_swap_ volume_ block_old_ libvirt had to volume_ block_old_ libvirt doesn't exist in Pike, so
be modified to account for the additional XMLDesc call from the bug
fix. The test_swap_
that's why we didn't hit this in the master patch.
Change-Id: I166cde5ad8b006 99e4ec02609f0d7 b69236d855d 28dc50a0ef84095 ebd96d198d)
(cherry picked from commit 5b008c6540f948d