GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — kvm: let libvirt remove RBD snapshots on volume delete by wido · Pull Request #13763 · apache/cloudstack Conversation
Contributor
DescriptionLibvirtStorageAdaptor#deletePhysicalDisk manually connected to Ceph via librados/librbd to unprotect and remove every snapshot of an RBD image before asking libvirt to delete the volume. libvirt's RBD storage backend has supported VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS since 1.2.20, which does the same unprotect/remove internally. Pass that flag instead and drop the manual cleanup. Types of changes
Feature/Enhancement Scale or Bug SeverityFeature/Enhancement Scale
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsLibvirtStorageAdaptor#deletePhysicalDisk manually connected to Ceph via librados/librbd to unprotect and remove every snapshot of an RBD image before asking libvirt to delete the volume. libvirt's RBD storage backend has supported VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS since 1.2.20, which does the same unprotect/remove internally. Pass that flag instead and drop the manual cleanup.
|
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #13763 +/- ## ========================================= Coverage 19.65% 19.65% + Complexity 19792 19789 -3 ========================================= Files 6368 6368 Lines 574881 574843 -38 Branches 70351 70349 -2 ========================================= - Hits 112970 112963 -7 + Misses 449639 449607 -32 - Partials 12272 12273 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
nice ! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Tnx! Fun is that I implemented this in Libvirt over 10y ago and totally forgot to fix it in CloudStack. Simple change to reduce the amount of code, better to have Libvirt do this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
yeah. I have waited 4 years for the fix for #6180 😆 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Here is the first one! Have a look at the code and review it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@blueorangutan package kvm |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@andrijapanicsb a [SL] Jenkins job has been kicked to build packages. It will be bundled with kvm SystemVM template(s). I'll keep you posted as I make progress. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 18734 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@blueorangutan package |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18735 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@wido, given your comments, should we add this in 4.20 LTS? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR simplifies KVM RBD volume deletion by delegating RBD snapshot cleanup to libvirt, using the VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS delete flag, and removing the prior manual Ceph (librados/librbd) snapshot unprotect/remove logic from deletePhysicalDisk.
Changes:
VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS flag (raw value) and conditionally applies it when deleting RBD-backed libvirt volumes.deleteVol(...) for RBD pools.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It is not going to fix anything, this is mainly code cleanup. I would not put that into an LTS personally |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
clgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@blueorangutan test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@weizhouapache the DEB packaging seems randomly failing - I have run it on this specific PR to isolate a potential issue with my own PR ("prove" random failure on this PR) - and it seems it is random indeed? See #13656 (comment) Will kick off another round, really curious if it's going to fail. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
it failed at due to cc @NuxRo cloudstack build has dependency on your server 😄 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[SF] Trillian Build Failed (tid-16672) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@blueorangutan test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
hehehehe - btw, http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-kvm.qcow2.bz2 - works for me.... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
yes, the issue happened very rarely |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[SF] Trillian Build Failed (tid-16676) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@blueorangutan test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Is this behaviour consistent with general ACS behaviour - I think, for some funny reason - we do leave volume snapshots hanging around when an original volume is deleted - we should inclusively (storage-unrelated, NFS, CEPH, etc,) remove all related volume snapshots - if that is the decision - not just CEPH (but I absolutely support this garbage collection 😁 ) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think it is ceph-only: volume cannot be removed if volume snapshots exist. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That is correct, Ceph refuses the removal if a snapshot exists. Again, this PR is just to clean-up code in CloudStack's Agent. Less code == better |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
[SF] Trillian test result (tid-16678)
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This one has two approvals and is fairly small. Think we can merge it, right? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I didn’t test it, but if it was tested, yes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I run into an error while testing this PR the issue is due to that there is still a watcher on the RBD image. the issue is finally solved by #13835 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
tested ok
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Conflicts: - LibvirtStorageAdaptor.java: apache#13763 added VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS next to LUKS2_HEADER_RESERVE_BYTES; kept both constants. - PendingReleaseNotes: kept the UEFI NVRAM entry from main and moved the encrypted RBD entry under 4.23.0.0 > 24.0.0, since 4.23.0.0 has been released without it and main is now 24.0.0-SNAPSHOT.
Commit 26e7c3f (apache#13763, let libvirt remove RBD snapshots on volume delete) removed the com.ceph.rados.exceptions.ErrorCode import together with its last uses. Commit 08a706d (apache#14188, look RBD volumes up through librbd instead of refreshing the pool) brought the uses back without the import, so plugins/hypervisors/kvm failed to compile.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.