Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14484 +/- ##
============================================
+ Coverage 20.76% 20.92% +0.16%
+ Complexity 21903 21149 -754
============================================
Files 6496 6057 -439
Lines 591612 549567 -42045
Branches 72585 73481 +896
============================================
- Hits 122851 115010 -7841
+ Misses 455424 421110 -34314
- Partials 13337 13447 +110
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:
|
|
@blueorangutan package |
|
@Pearl1594 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19694 |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
What changed in this PR
Adds incremental volume snapshot support for CLVM-NG by treating it similarly to KVM/file-based incremental flows and enforcing secondary-storage requirements in the KVM storage processor.
Changes:
- Enable incremental snapshot payload/flow for
StoragePoolType.CLVM_NGwhenkvmIncrementalSnapshotis enabled. - Adjust snapshot-to-secondary handling to avoid double-backup for CLVM-NG incremental snapshots.
- Add CLVM-NG incremental validation in KVM snapshot creation (requires secondary storage; supports live/paused cases).
| File | Description |
|---|---|
| server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java | Enables CLVM-NG to participate in the incremental snapshot/secondary-store allocation flow and adjusts backup behavior accordingly. |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java | Adds CLVM-NG incremental snapshot checks and routes live/stopped snapshot handling through incremental paths using secondary storage. |
Review effort: Lite
| if (isClvmNgIncremental) { | ||
| logger.info("Taking incremental snapshot of CLVM_NG volume [{}] using QCOW2 backup to secondary storage.", volume.getName()); | ||
| newSnapshot = takeIncrementalVolumeSnapshotOfStoppedVm(snapshotTO, primaryPool, secondaryPool, | ||
| imageStoreTo.getUrl(), snapshotName, volume, conn, cmd.getWait()); |
There was a problem hiding this comment.
this is a false positive - there's a guard before. So no NPE.
|
|
||
| StoragePoolType poolType = volume.getStoragePoolType(); | ||
| boolean isClvmNgIncrementalCandidate = StoragePoolType.CLVM_NG == poolType && kvmIncrementalSnapshot.valueIn(clusterId); | ||
|
|
There was a problem hiding this comment.
Addressed by a different fix. CLVM_NG incremental is now gated on backupSnapToSecondary, so it falls back to the primary LVM path instead of failing.
| } | ||
| boolean isLiveClvmNgIncremental = isClvmNgIncremental && (DomainInfo.DomainState.VIR_DOMAIN_RUNNING.equals(state) || DomainInfo.DomainState.VIR_DOMAIN_PAUSED.equals(state)); | ||
| if ((DomainInfo.DomainState.VIR_DOMAIN_RUNNING.equals(state) && !primaryPool.isExternalSnapshot()) || isLiveClvmNgIncremental) { | ||
| if (snapshotTO.isKvmIncrementalSnapshot()) { |
JoaoJandre
left a comment
There was a problem hiding this comment.
CLGTM, did not test it
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
Hi @Pearl1594 can you please address the conflicts? |
There was a problem hiding this comment.
🟡 Changes recommended
CLVM-NG incremental snapshots can retain incorrect full-volume charges, omit requested replicas with asynchronous backup, and fail in primary-only configurations.
6 open issues
imageStoreTo.getUrl()can throw a NullPointerException ifimageStoreTois null. The earlier… Use the image-store reference for incremental snapshot accounting · New Create requested destination replicas for async CLVM-NG incrementals · New Require secondary archival for CLVM-NG incremental mode · New CLVM-NG incremental snapshots appear to require secondary storage (enforced later in…takeIncrementalVolumeSnapshotOfRunningVm(...)is now used for theVIR_DOMAIN_PAUSEDstate as…
Review effort: Balanced
|
|
||
| if (archiveSnapshotToSecondary) { | ||
| if (!isKvmAndFileBasedStorage) { | ||
| if (!isKvmAndFileBasedStorage && !isClvmNgIncrementalCandidate) { |
| if (!isKvmAndFileBasedStorage && !isClvmNgIncrementalCandidate) { | ||
| backupSnapshotToSecondary(payload.getAsyncBackup(), snapshotStrategy, snapshotOnPrimary, payload.getZoneIds(), payload.getStoragePoolIds()); |
There was a problem hiding this comment.
following the same as file based kvm path
| } | ||
|
|
||
| if (isKvmAndFileBasedStorage && kvmIncrementalSnapshot.valueIn(clusterId)) { | ||
| if ((isKvmAndFileBasedStorage || StoragePoolType.CLVM_NG == poolType) && kvmIncrementalSnapshot.valueIn(clusterId)) { |
|
@blueorangutan package |
|
@Pearl1594 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. |
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 25.87% |
| Branch coverage | 21.09% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✖️ suse15. SL-JID 19869 |
|
@blueorangutan package |
|
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
@RosiKyu I found an issue with bitmap removal for a stopped VM and when the disks have moved: |
|
@blueorangutan package |
|
@Pearl1594 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20040 |
|
[SF] Trillian test result (tid-17568)
|
|
@Pearl1594 I've re-tested, the bitmap removal fix works: with the VM stopped and its disk moved so it is active on another host, the snapshot delete succeeds and goes to the host holding the disk. More regression and negative tests passed too: detached disk, plain CLVM, revert and volume/template from a snapshot with the disk on another host than the stopped VM's last host, VM moved between hosts, two snapshots at once, snapshot while the VM starts, host reboot. One problem found: after deleting a snapshot that has a newer snapshot after it and restarting the VM, every new snapshot of the CLVM_NG disk fails with only "internal error". Moving the disk to the other CLVM_NG pool does not help. Reproduced 3 out of 3 times, with the VM running or stopped at the time of the delete. Steps to reproduce:
On the start in step 3 the host cannot restore the checkpoint of S3 because its parent (S2) is gone, so the snapshot in step 4 cannot find it. Lab mapping: API, steps 1 to 4: S2 deleted, VM restarted, the next snapshot fails Host H, steps 3 and 4: the checkpoint of S3 cannot be restored because S2 is gone, then the snapshot fails (the first line is the same problem on another disk from an earlier run) |
|
Thanks for testing @RosiKyu . This seems to be an issue that also exists on NFS/ file based stgs. I will push a fix today. Sorry for the delay. Thanks! |
…e snapshot was deleted
|
@blueorangutan package |
|
@Pearl1594 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20132 |
|
LGTM @Pearl1594 I retested the fix for incremental snapshots failing after a middle snapshot is deleted and the VM is restarted (3aa5dc3), with the PR packages on a 4-host KVM cluster with NFS and CLVM_NG pools,
Lab mapping: VM V = Clean 24.0 build, NFS disk D1: after deleting the middle snapshot and restarting V, the next snapshots fail PR packages, NFS disk D1, V running at the delete: the next snapshots succeed PR packages, CLVM_NG disk D2, W running at the delete: the next snapshots succeed PR packages, CLVM_NG disk D2, W stopped at the delete: the next snapshots succeed |
|
@Pearl1594 could you please review the copilot comments? Thank you! |
|
@blueorangutan test |
|
@RosiKyu a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-17613)
|
|
@blueorangutan package |
|
@Pearl1594 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. |
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20176 |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20177 |





Description
This PR adds support for incremental volume snapshots for CLVM-NG
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
snapshot.delta.maxchain rolloverHow did you try to break this feature and the system with this change?