libvirt: flatten rbd images when unshelving an instance
Previously attempts to remove the shelved snapshot of an unshelved
instance when using the rbd backends for both Nova and Glance would
fail. This was due to the instance disk being cloned from and still
referencing the shelved snapshot image in Glance, blocking any attempt
to remove this image later in the unshelve process.
After much debate this change attempts to fix this issue by flattening
the instance disk while the instance is being spawned as part of an
unshelve. For the rbd imagebackend this removes any reference to the
shelved snapshot in Glance allowing this image to be removed. For all
other imagebackends the call to flatten the image is currently a no-op.
NOTE(lyarwood): Test conflicts due to Ie3130e104d7ca80289f1bd9f0fee9a7a198c263c
and I407034374fe17c4795762aa32575ba72d3a46fe8 not being present in
stable/queens. Note that the latter was backported but then reverted via
Ibf2b5eeafd962e93ae4ab6290015d58c33024132 resulting in this conflict.
Reviewed: https:/ /review. opendev. org/668123 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=d2f91755ab7 4372a966b0ebae7 10beccabef0821
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit d2f91755ab74372 a966b0ebae710be ccabef0821
Author: rsritesh <email address hidden>
Date: Wed Apr 19 12:02:30 2017 +0530
libvirt: flatten rbd images when unshelving an instance
Previously attempts to remove the shelved snapshot of an unshelved
instance when using the rbd backends for both Nova and Glance would
fail. This was due to the instance disk being cloned from and still
referencing the shelved snapshot image in Glance, blocking any attempt
to remove this image later in the unshelve process.
After much debate this change attempts to fix this issue by flattening
the instance disk while the instance is being spawned as part of an
unshelve. For the rbd imagebackend this removes any reference to the
shelved snapshot in Glance allowing this image to be removed. For all
other imagebackends the call to flatten the image is currently a no-op.
Co-Authored-By: Lee Yarwood <email address hidden>
Co-Authored-By: Vladyslav Drok <email address hidden>
NOTE(lyarwood): Test conflicts due to Ie3130e104d7ca8 0289f1bd9f0fee9 a7a198c263c 4795762aa32575b a72d3a46fe8 not being present in 962e93ae4ab6290 015d58c33024132 resulting in this conflict.
and I407034374fe17c
stable/queens. Note that the latter was backported but then reverted via
Ibf2b5eeafd
Conflicts:
nova/tests/ unit/virt/ libvirt/ test_driver. py
Closes-Bug: #1653953 394405bd1e1f0fa 08ce2baeda8 6c3b088338272c2 4d0618c07f) 7590620abc14230 0a57bcf349) 012f759a4ffbe52 89112ba490)
Change-Id: If3c9d1de3ce0fe
(cherry picked from commit d89e7d7857e0ab5
(cherry picked from commit e802ede4b30b21c
(cherry picked from commit e93bc57a73d8642