| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
LibvirtStorageAdaptor#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.
Codecov Report❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
@@ 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.
|
Sorry, something went wrong.
|
nice ! |
Sorry, something went wrong.
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.
yeah. I have waited 4 years for the fix for #6180 😆 |
Sorry, something went wrong.
Here is the first one! Have a look at the code and review it. |
Sorry, something went wrong.
|
@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.
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 18734 |
Sorry, something went wrong.
|
@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.
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18735 |
Sorry, something went wrong.
|
@wido, given your comments, should we add this in 4.20 LTS? |
Sorry, something went wrong.
There was a problem hiding this comment.
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:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
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 a problem hiding this comment.
clgtm
Sorry, something went wrong.
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Sorry, something went wrong.
|
@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.
it failed at 22:02:41 [ERROR] Failures: 22:02:41 [ERROR] MetalinkDirectTemplateDownloaderTest.testCheckUrlMetalink:33 due to 22:02:39 20:02:40.901 [main] ERROR org.apache.cloudstack.direct.download.HttpDirectTemplateDownloader - Cannot reach URL: http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-kvm.qcow2.bz2 due to: The host did not accept the connection within timeout of 1000 ms 22:02:40 org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 1000 ms 22:02:40 at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:155) ~[commons-httpclient-3.1.jar:?] 22:02:40 at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125) ~[commons-httpclient-3.1.jar:?] 22:02:40 at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) ~[commons-httpclient-3.1.jar:?] 22:02:40 at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361) ~[commons-httpclient-3.1.jar:?] 22:02:40 at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) ~[commons-httpclient-3.1.jar:?] 22:02:40 at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) ~[commons-httpclient-3.1.jar:?] 22:02:40 at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) ~[commons-httpclient-3.1.jar:?] 22:02:40 at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) ~[commons-httpclient-3.1.jar:?] 22:02:40 at org.apache.cloudstack.direct.download.HttpDirectTemplateDownloader.checkUrl(HttpDirectTemplateDownloader.java:120) ~[classes/:?] 22:02:40 at org.apache.cloudstack.direct.download.MetalinkDirectTemplateDownloader.checkUrl(MetalinkDirectTemplateDownloader.java:143) ~[classes/:?] 22:02:40 at org.apache.cloudstack.direct.download.MetalinkDirectTemplateDownloaderTest.testCheckUrlMetalink(MetalinkDirectTemplateDownloaderTest.java:32) ~[test-classes/:?] cc @NuxRo cloudstack build has dependency on your server 😄 |
Sorry, something went wrong.
|
[SF] Trillian Build Failed (tid-16672) |
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.
|
hehehehe - btw, http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-kvm.qcow2.bz2 - works for me.... |
Sorry, something went wrong.
yes, the issue happened very rarely |
Sorry, something went wrong.
|
[SF] Trillian Build Failed (tid-16676) |
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.
|
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.
I think it is ceph-only: volume cannot be removed if volume snapshots exist. |
Sorry, something went wrong.
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.
|
[SF] Trillian test result (tid-16678)
|
Sorry, something went wrong.
|
This one has two approvals and is fairly small. Think we can merge it, right? |
Sorry, something went wrong.
I didn’t test it, but if it was tested, yes. |
Sorry, something went wrong.
|
I run into an error while testing this PR 2026-09-08 11:45:32,284 DEBUG [kvm.storage.KVMStorageProcessor] (AgentRequest-Handler-5:[]) (logid:5bac7a1f) Failed to delete volume: com.cloud.utils.exception.CloudRuntimeException: failed to remove volume 'cloudstack/25d82bb7-6380-45bc-9eea-2a4bd290a924': Success
at com.cloud.hypervisor.kvm.storage.LibvirtStorageAdaptor.deletePhysicalDisk(LibvirtStorageAdaptor.java:1170)
at com.cloud.hypervisor.kvm.storage.LibvirtStoragePool.deletePhysicalDisk(LibvirtStoragePool.java:201)
at com.cloud.hypervisor.kvm.storage.KVMStorageProcessor.deleteVolume(KVMStorageProcessor.java:2908)
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 a problem hiding this comment.
tested ok
Sorry, something went wrong.
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.
| Back | FazBrowse Home | New Git URL |
Description
LibvirtStorageAdaptor#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 Severity
Feature/Enhancement Scale