| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Codecov Report❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## 4.22 #14132 +/- ##
=========================================
Coverage 17.93% 17.93%
- Complexity 16140 16149 +9
=========================================
Files 5928 5928
Lines 535174 535194 +20
Branches 65494 65497 +3
=========================================
+ Hits 95968 96007 +39
+ Misses 428280 428256 -24
- Partials 10926 10931 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
|
@weizhouapache I see.. so your changes only run this for KVM + Ceph volumes, and it sits in the volume delete path instead of the storage cleanup loop. That fills the gap I had. Mine was running on every volume expunge no matter the storage type. I guess I will go ahead and close mine: #12813 |
Sorry, something went wrong.
Fixes apache#12002. On Ceph/RBD primary storage, deleting a volume also destroys any of its remaining snapshots: LibvirtStorageAdaptor#deleteVol passes VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS for RBD pools, so libvirt unprotects and removes them along with the image. Run that same snapshots cleanup earlier: for a KVM + RBD volume, delete its primary-only snapshots before sending the volume delete command, while they can still be found and removed cleanly. This is the choke point shared by both the standalone DeleteVolume API and VM destroy/expunge, so it covers both affected flows. The existing post-delete cleanup in deleteVolumeCallback stays in place as a no-op safety net for anything this pass didn't find. Verified live on a KVM + Ceph environment (RBD primary storage, snapshot.backup.to.secondary=false): destroying a VM with a primary-only snapshot now deletes it cleanly.
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Sorry, something went wrong.
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19222 |
Sorry, something went wrong.
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Sorry, something went wrong.
|
[SF] Trillian test result (tid-16978)
|
Sorry, something went wrong.
| future.complete(result); | ||
| return future; | ||
| } | ||
| deletePrimaryOnlySnapshotsBeforeRbdVolumeDelete(vol); |
There was a problem hiding this comment.
what happens if the volume delete fails after this? looks like the snapshots are already gone by then
Sorry, something went wrong.
There was a problem hiding this comment.
@Damans227
Yes, primary-only snapshots (those not backed up to secondary storage) will be gone even if the volume delete then fails. CloudStack Ceph users should be aware of this behaviour.
Deleting the snapshots before removing the volume has these benefits:
The drawback is extra time, since each snapshot needs its own delete command to the agent. I think that cost is acceptable.
The alternative is to delete the volume first and then clean up the snapshots. It saves time, but if the deletion fails, we can't tell what state the snapshots are in without checking the volume.
Sorry, something went wrong.
There was a problem hiding this comment.
makes sense, keeping the counts and events right is worth it. should we add a line in the docs so ceph users know the snapshots go first?
Sorry, something went wrong.
There was a problem hiding this comment.
created doc PR apache/cloudstack-documentation#688
@Damans227
Sorry, something went wrong.
There was a problem hiding this comment.
that covers it, thanks. can the note also say the snapshots stay deleted if the volume delete fails?
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
This PR fixes #12002
On Ceph/RBD primary storage, deleting a volume also destroys any of its remaining snapshots: LibvirtStorageAdaptor#deleteVol passes VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS for RBD pools, so libvirt unprotects and removes them along with the image.
Run that same snapshots cleanup earlier: for a KVM + RBD volume, delete its primary-only snapshots before sending the volume delete command, while they can still be found and removed cleanly. This is the choke point shared by both the standalone DeleteVolume API and VM destroy/expunge, so it covers both affected flows. The existing post-delete cleanup in deleteVolumeCallback stays in place as a no-op safety net for anything this pass didn't find.
Verified live on a KVM + Ceph environment (RBD primary storage, snapshot.backup.to.secondary=false): destroying a VM with a primary-only snapshot now deletes it cleanly.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?