Skip to content

Add support for clvm-ng incremental volume snaps - #14484

Draft
Pearl1594 wants to merge 8 commits into
mainfrom
clvm-ng-bitmap-incsnaps
Draft

Pearl1594 wants to merge 8 commits into
mainfrom
clvm-ng-bitmap-incsnaps

Conversation

@Pearl1594

Copy link
Copy Markdown
Contributor

Description

This PR adds support for incremental volume snapshots for CLVM-NG

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

How Has This Been Tested?

  • 5-deep ROOT incremental chain with data written between snapshots - File-level: write and change files in the guest across three snapshots; revert to the first incremental and to a mid-chain incremental, files as expected
  • Incremental snapshot on a stopped VM (ROOT and data volumes)
  • Incremental snapshot on a running VM with the guest writing
  • Restore snapshots to new volumes, byte-identical to the source
  • Create volume from snapshot; template from snapshot, VM boots
  • Delete a middle snapshot: goes Hidden, chain intact
  • Delete the last child
  • Live VM migration, then incremental snapshot
  • Volume migration across VGs, then incremental snapshot and restore
  • Revert a data volume, then snapshot (new full after revert)
  • ROOT revert after VM migration
  • snapshot.delta.max chain rollover
  • Live resize, then snapshot and restore
  • Hourly snapshot policy
  • Snapshot right after boot with the guest writing, then a stopped incremental identical to the LV
  • Forced stop VM, restart on another host, then incremental snaps

How did you try to break this feature and the system with this change?

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 36.36364% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.17%. Comparing base (d6390bd) to head (0cc7e84).
⚠️ Report is 67 commits behind head on main.

Files with missing lines Patch % Lines
...om/cloud/storage/snapshot/SnapshotManagerImpl.java 47.82% 10 Missing and 2 partials ⚠️
...storage/datastore/db/SnapshotDataStoreDaoImpl.java 0.00% 9 Missing ⚠️
...ud/hypervisor/kvm/storage/KVMStorageProcessor.java 0.00% 6 Missing ⚠️
.../storage/vmsnapshot/StorageVMSnapshotStrategy.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14484      +/-   ##
============================================
+ Coverage     20.76%   21.17%   +0.40%     
+ Complexity    21903    21579     -324     
============================================
  Files          6496     6080     -416     
  Lines        591612   551792   -39820     
  Branches      72585    73942    +1357     
============================================
- Hits         122851   116839    -6012     
+ Misses       455424   421158   -34266     
- Partials      13337    13795     +458     
Flag Coverage Δ
uitests 3.87% <ø> (-0.01%) ⬇️
unittests 22.64% <36.36%> (+0.56%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19694

@Pearl1594
Pearl1594 marked this pull request as ready for review October 23, 2026 13:38
Copilot AI balanced review requested due to automatic review settings October 23, 2026 13:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_NG when kvmIncrementalSnapshot is 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

Comment on lines +2120 to 2123
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());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not required.

@JoaoJandre JoaoJandre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLGTM, did not test it

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@nvazquez

nvazquez commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Hi @Pearl1594 can you please address the conflicts?

Copilot AI balanced review requested due to automatic review settings November 1, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 26.23%
Branch coverage 21.51%

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

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✖️ suse15. SL-JID 19869

@RosiKyu

RosiKyu commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

@blueorangutan package

@RosiKyu

RosiKyu commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

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, kvm.incremental.snapshot=true.

  • I confirmed first that the problem is not from this PR: on a clean 24.0 build the same steps fail on NFS too.
  • With the fix: snapshot S1, S2, S3, delete S2, stop and start the VM, the next snapshots succeed on NFS and on CLVM_NG, with the VM running or stopped at the delete.
  • Upgrade: a chain broken on 24.0 (NFS) works again after upgrading to the PR packages, once the VM is stopped and started.
  • Other cases now work too: deleting the first snapshot or two middle ones, then restarting. On 24.0 they broke the chain the same way.
  • Regression, same result as on 24.0 (NFS and CLVM_NG): restart with no deleted snapshots, deleting the last snapshot, deleting all snapshots, volume, template and revert from a snapshot, live migration, VM snapshot allowed with no volume snapshots and refused while incremental snapshots exist, kvm.incremental.snapshot=false.

Lab mapping: VM V = vm-ha-nfs (NFS root disk D1 a30650c9-ef44-43ca-95b5-8593aca1bc2b), VM W = vm-t1 (CLVM_NG root disk D2 b115e913-4dc1-46e4-9a99-1e9e32619d2d).

Clean 24.0 build, NFS disk D1: after deleting the middle snapshot and restarting V, the next snapshots fail

  NF-1: jobstatus 1 
  NF-2: jobstatus 1 
  NF-3: jobstatus 1 
  -- delete NF-2 (middle), 15:38:32
  delete NF-2: jobstatus 1 "success": true 
  stop vm-ha-nfs: jobstatus 1 
  start vm-ha-nfs: jobstatus 1  Running ref-trl-12929-k-mol8-rositsa-kyuchukova-kvm4 i-2-7-VM
  -- snapshot NF-4 after the restart, 15:40:53
  NF-4: jobstatus 2 "errortext": "Failed to create Snapshot due to an internal error creating Snapshot for volume a30650c9-ef44-43ca-95b5-8593aca1bc2b" 
  NF-5: jobstatus 2 "errortext": "Failed to create Snapshot due to an internal error creating Snapshot for volume a30650c9-ef44-43ca-95b5-8593aca1bc2b" 

PR packages, NFS disk D1, V running at the delete: the next snapshots succeed

  PN-1: jobstatus 1 
  PN-2: jobstatus 1 
  PN-3: jobstatus 1 
  -- delete PN-2 (middle) 16:29:41
  delete PN-2: jobstatus 1 "success": true 
  stop vm-ha-nfs: jobstatus 1 
  start vm-ha-nfs: jobstatus 1  Running kvm1
  -- snapshots after the restart 16:30:37
  PN-4: jobstatus 1 
  PN-5: jobstatus 1 

PR packages, CLVM_NG disk D2, W running at the delete: the next snapshots succeed

  PG-1: jobstatus 1 
  PG-2: jobstatus 1 
  PG-3: jobstatus 1 
  -- delete PG-2 (middle) 16:31:43
  delete PG-2: jobstatus 1 "success": true 
  stop vm-t1: jobstatus 1 
  start vm-t1: jobstatus 1  Running kvm4
  -- snapshots after the restart 16:32:49
  PG-4: jobstatus 1 
  PG-5: jobstatus 1 

PR packages, CLVM_NG disk D2, W stopped at the delete: the next snapshots succeed

  PS-1: jobstatus 1 
  PS-2: jobstatus 1 
  PS-3: jobstatus 1 
  stop vm-t1: jobstatus 1 
  -- delete PS-2 (middle), VM stopped 16:34:26
  delete PS-2: jobstatus 1 "success": true 
  start vm-t1: jobstatus 1  Running kvm4
  -- snapshots after the start 16:34:47
  PS-4: jobstatus 1 
  PS-5: jobstatus 1 

@RosiKyu

RosiKyu commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

@Pearl1594 could you please review the copilot comments? Thank you!

@RosiKyu

RosiKyu commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@RosiKyu a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-17613)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 65094 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr14484-t17613-kvm-ol8.zip
Smoke tests completed. 157 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20176

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20177

@RosiKyu

RosiKyu commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

@Pearl1594 I tested snapshot copies to a second zone with the PR packages and with the 24.0 build, on the same lab with fresh VMs for each build. One difference showed up.

Test coverage

  1. Two zones, KVM. Zone 1 has CLVM_NG and NFS primary storage, zone 2 has its own NFS primary and secondary storage. kvm.incremental.snapshot=true, snapshot.backup.to.secondary=true.
  2. Snapshot of a CLVM_NG root disk with zone 2 picked: first one and second one in the chain. Both are BackedUp in zone 1 and zone 2.
  3. Copy of a zone 1 only snapshot to zone 2. OK.
  4. Volume in zone 2 from the zone 2 copy, attached to a VM in zone 2. OK.
  5. Template in zone 2 from the zone 2 copy, VM deployed in zone 2 from it. Running.
  6. Delete of only the zone 2 copy. The zone 1 copy stays.
  7. snapshot.backup.to.secondary=false with zone 2 picked: refused with "Backing up of snapshot has been disabled. Snapshot can not be taken for multiple zones", same as on 24.0.

Difference from 24.0

Snapshot of a CLVM_NG root disk with asyncbackup=true and zone 2 picked:

  1. Take a snapshot of the root disk of a running VM on CLVM_NG storage, with Async backup on and zone 2 selected.
  2. Check the snapshot's zones after a few minutes.

On 24.0 the snapshot is BackedUp in zone 1 and zone 2. With the PR packages it is BackedUp in zone 1 only. The snapshot job succeeds, there is no SNAPSHOT.COPY event and no error or alert. I saw this twice, the second time checked again after 90 seconds.

The same snapshot without Async backup reaches zone 2 with the PR packages. An NFS root disk with Async backup and zone 2 selected also stays in zone 1 only, on both 24.0 and the PR packages.

Is zone 1 only the intended result for CLVM_NG with Async backup now? If yes, an error or a note when zones are selected would help, since the request reports success.

@Pearl1594

Copy link
Copy Markdown
Contributor Author

Thanks for extensively testing this @RosiKyu I hadn't checked the multi zone path, so the change from yday changed the behavior for async + zone selected, it should be addressed now. Thanks!

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20200

@Pearl1594

Copy link
Copy Markdown
Contributor Author

Added a restriction to prevent snaps for vols on clvm/clvm-ng with snapshot.backup.to.secondary false, while snapshot creation succeeds, revert wouldnt work so there's no point in supporting it.

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20209

@RosiKyu
RosiKyu self-requested a review December 2, 2026 11:27
@RosiKyu

RosiKyu commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

@Pearl1594 retested with the PR packages of the latest commit, on the same lab (zone 1 with 4 KVM hosts and CLVM, CLVM_NG and NFS pools, zone 2 with 1 KVM host and an NFS pool, NFS secondary storage in each zone, kvm.incremental.snapshot=true).

With snapshot.backup.to.secondary=false, CLVM and CLVM_NG snapshots are now refused at once with a clear message ("Snapshots of volumes on CLVM_NG storage require [snapshot.backup.to.secondary] to be true.", the same with CLVM for a CLVM volume). Nothing is left behind and the next snapshots with true work. On a clean 24.0 build both are taken as full copies.

Two points before approving:

  1. NFS snapshot fails after moving from 24.0 to the PR packages with snapshot.backup.to.secondary=false. Steps: on a clean 24.0 build, set snapshot.backup.to.secondary=false, take a snapshot of the ROOT disk of a running VM on NFS. Install the PR packages (setting still false), take another snapshot of the same disk. Result: the first snapshot fails with "Failed to create Snapshot due to an internal error creating Snapshot for volume ..." (SNAPSHOT.CREATE "Error while taking snapshot"). The next one, 13 seconds later, works. Seen on 3 of 3 VMs at 18:34, and on 1 VM in an earlier run at 16:54. The other way round (snapshot with the PR packages, then the 24.0 build) works, and a plain agent restart on the PR packages between two snapshots does not cause it. With true across the same move, all snapshots worked (checked on an earlier commit of this PR). Is this expected?
  2. Hourly snapshot policy on a CLVM_NG disk with snapshot.backup.to.secondary=false: no snapshot is made, which matches the new rule. The user only sees a SNAPSHOT.CREATE "Scheduled" INFO event each time, with no error event; the message is only in the management server log. On 24.0 the same policy makes a full snapshot. Should the failed run show up for the user (an error event or alert)?

The docs PR apache/cloudstack-documentation#700 needs an update for this commit: it quotes the error as "Incremental snapshots for CLVM_NG require secondary storage" (the message is now "Snapshots of volumes on CLVM_NG storage require [snapshot.backup.to.secondary] to be true.") and it mentions only CLVM_NG, while the PR now also refuses CLVM snapshots with false.

Test coverage

New disks and a new VM created on each build, same steps on a clean 24.0 build and on the PR packages.

  • CLVM and CLVM_NG data disks: snapshots with true, then false (refused, see above), then back to true: the next snapshots are incremental again.
  • NFS with false: 2 snapshots each on 3 VMs (chains made on 24.0, on the PR packages, and after a revert), then true. All work, apart from point 1.
  • VM snapshot (disk only) of a CLVM_NG VM with true and false: "VM snapshots are not yet supported on CLVM_NG storage pools", the same on 24.0.
  • Template from a CLVM_NG snapshot taken with false on an earlier commit of this PR, and from one taken with false on 24.0: both Ready.
  • Hourly snapshot policy with false (point 2), on both builds.
  • 2 zones: CLVM_NG snapshot with asyncbackup=true and zone 2 selected: in both zones on both builds.

Not tested: a zone-level value of snapshot.backup.to.secondary. The setting is global only on this build, so there is no zone value to set.

Lab mapping: VM A = z2p-nfs (ROOT de0ba735-40e8-4722-817a-19727b81517b), VM B = z2b-nfs (ROOT 33e9375b-cd27-45f9-964d-0af0172b7b79), VM C = z2r-nfs (ROOT 72ad517b-c106-44e0-864c-08a32e6b974c), all on the NFS pool; CLVM_NG disk D = p4-ng (e44dceb6-93b5-40db-b418-278c83736c3b).

Clean 24.0 build, snapshot.backup.to.secondary=false: snapshots of the ROOT disks of VMs A, B and C

[root@ol8 ~]# rpm -q cloudstack-management
cloudstack-management-24.0.0-SNAPSHOT.20261125.noarch
==== 24.0, false: NFS snapshots, policy on the 24.0 CLVM_NG disk b4-ng
  17:53:26 set snapshot.backup.to.secondary=false: "value":"false"
  17:55:02 management server back: kvm1=Up kvm2=Up kvm3=Up kvm4=Up z2kvm1=Up
  kvm.incremental.snapshot: "value":"true"
  snapshot.backup.to.secondary: "value":"false"
  17:55:04 snapshot b6-ROOT-134-f1 of ROOT-134 : jobstatus 1 "state": "BackedUp" "physicalsize": 0 
  17:55:35 snapshot b6-ROOT-130-f1 of ROOT-130 : jobstatus 1 "state": "BackedUp" "physicalsize": 0 
  17:55:54 snapshot b6-ROOT-138-f1 of ROOT-138 : jobstatus 1 "state": "BackedUp" "physicalsize": 0 

After installing the PR packages (setting still false): two snapshots of each disk, then the management server log

[root@ol8 ~]# rpm -q cloudstack-management
cloudstack-management-24.0.0-shapeblue22973.noarch
  kvm.incremental.snapshot: "value":"true"
  snapshot.backup.to.secondary: "value":"false"
  18:34:01 snapshot p6-ROOT-134-f1 of ROOT-134 : jobstatus 2 "errortext": "Failed to create Snapshot due to an internal error creating Snapshot for volume de0ba735-40e8-4722-817a-19727b81517b" 
  18:34:14 snapshot p6-ROOT-134-f2 of ROOT-134 : jobstatus 1 "state": "BackedUp" "physicalsize": 0 
  18:34:21 snapshot p6-ROOT-130-f1 of ROOT-130 : jobstatus 2 "errortext": "Failed to create Snapshot due to an internal error creating Snapshot for volume 33e9375b-cd27-45f9-964d-0af0172b7b79" 
  18:34:34 snapshot p6-ROOT-130-f2 of ROOT-130 : jobstatus 1 "state": "BackedUp" "physicalsize": 0 
  18:34:53 snapshot p6-ROOT-138-f1 of ROOT-138 : jobstatus 2 "errortext": "Failed to create Snapshot due to an internal error creating Snapshot for volume 72ad517b-c106-44e0-864c-08a32e6b974c" 
  18:35:06 snapshot p6-ROOT-138-f2 of ROOT-138 : jobstatus 1 "state": "BackedUp" "physicalsize": 0 
  -- management server
[root@ol8 ~]# grep -E 'require \[snapshot.backup.to.secondary\]|Failed to create snapshot|backup.to.secondary' /var/log/cloudstack/management/management-server.log | awk '$2>="18:34:01"'
2026-11-27 18:34:01,871 WARN  [c.c.c.ConfigurationManagerImpl] (qtp508378341-21:[ctx-2fafa95b, ctx-639afe0f]) (logid:0eb93c78) Did not find configuration [snapshot.backup.to.secondary] in Config.java. Perhaps moved to ConfigDepot.
2026-11-27 18:34:14,290 DEBUG [c.c.s.s.SnapshotManagerImpl] (Work-Job-Executor-5:[ctx-440874d1, job-3533/job-3534, ctx-5a918f49]) (logid:c604af02) Failed to create snapshotjava.lang.NullPointerException: Cannot invoke "org.w3c.dom.Node.setTextContent(String)" because "parentNameNode" is null
2026-11-27 18:34:17,999 DEBUG [c.c.s.s.SnapshotManagerImpl] (Work-Job-Executor-6:[ctx-3487c461, job-3535/job-3536, ctx-598707cf]) (logid:6cf8965f) Skipping backup of snapshot [e345a3ef-3e03-4afa-b703-bd5d34a86ea6] to secondary due to configuration [snapshot.backup.to.secondary].
2026-11-27 18:34:33,810 DEBUG [c.c.s.s.SnapshotManagerImpl] (Work-Job-Executor-7:[ctx-203ee6ef, job-3537/job-3538, ctx-c19d7fa1]) (logid:50dd2e7d) Failed to create snapshotjava.lang.NullPointerException: Cannot invoke "org.w3c.dom.Node.setTextContent(String)" because "parentNameNode" is null
2026-11-27 18:34:48,004 DEBUG [c.c.s.s.SnapshotManagerImpl] (Work-Job-Executor-8:[ctx-93f8f474, job-3539/job-3540, ctx-32e870fa]) (logid:0b64df6f) Skipping backup of snapshot [eb9eecda-4e0a-43a7-8549-fa4f9194b328] to secondary due to configuration [snapshot.backup.to.secondary].
2026-11-27 18:35:05,852 DEBUG [c.c.s.s.SnapshotManagerImpl] (Work-Job-Executor-9:[ctx-ce1cc646, job-3541/job-3542, ctx-ea209a5e]) (logid:e4b10300) Failed to create snapshotjava.lang.NullPointerException: Cannot invoke "org.w3c.dom.Node.setTextContent(String)" because "parentNameNode" is null

PR packages, snapshot.backup.to.secondary=false: CLVM and CLVM_NG snapshots refused

  16:52:31 set snapshot.backup.to.secondary=false: "value":"false"
  16:54:07 management server back: kvm1=Up kvm2=Up kvm3=Up kvm4=Up z2kvm1=Up
  kvm.incremental.snapshot: "value":"true"
  snapshot.backup.to.secondary: "value":"false"
  16:54:09 snapshot p4-clvm-f1 of p4-clvm : "errortext":"Snapshots of volumes on CLVM storage require [snapshot.backup.to.secondary] to be true." 
  16:54:10 snapshot p4-ng-f1 of p4-ng : "errortext":"Snapshots of volumes on CLVM_NG storage require [snapshot.backup.to.secondary] to be true." 

PR packages, snapshot.backup.to.secondary=false: hourly policy on disk D, events and management server log

  17:10:11 createSnapshotPolicy hourly minute 12: "id":"913cb657-8622-46ee-9c25-2bc3f0561efe"
  17:20:12 snapshots of p4-ng:
    p4-ng-t1 BackedUp 786432
    p4-ng-t2 BackedUp 196672
    p4-ng-t3 BackedUp 196672
  -- events since 17:10:11
    2026-11-27T17:12:56+0000 SNAPSHOT.CREATE Scheduled INFO creating snapshot for volume Id:e44dceb6-93b5-40db-b418-278c83736c3b
    2026-11-27T17:17:56+0000 SNAPSHOT.CREATE Scheduled INFO creating snapshot for volume Id:e44dceb6-93b5-40db-b418-278c83736c3b
  -- management server
[root@ol8 ~]# grep -E 'require \[snapshot.backup.to.secondary\]|Failed to create snapshot|backup.to.secondary' /var/log/cloudstack/management/management-server.log | awk '$2>="17:10:11"'
2026-11-27 17:12:56,272 ERROR [c.c.s.s.SnapshotSchedulerImpl] (SnapshotPollTask:[ctx-f007efc0]) (logid:8624fae8) The scheduling of snapshot [SnapshotSchedule {"id":3,"policyId":3,"uuid":"81b456d0-99e3-48c1-845e-38fc3ec7ea3f","volumeId":187}] for volume [Volume {"id":187,"instanceId":8,"name":"p4-ng","uuid":"e44dceb6-93b5-40db-b418-278c83736c3b","volumeType":"DATADISK"}] failed due to [com.cloud.exception.InvalidParameterValueException: Snapshots of volumes on CLVM_NG storage require [snapshot.backup.to.secondary] to be true.]. com.cloud.exception.InvalidParameterValueException: Snapshots of volumes on CLVM_NG storage require [snapshot.backup.to.secondary] to be true.
2026-11-27 17:17:56,352 ERROR [c.c.s.s.SnapshotSchedulerImpl] (SnapshotPollTask:[ctx-df51393d]) (logid:c688aaad) The scheduling of snapshot [SnapshotSchedule {"id":3,"policyId":3,"uuid":"81b456d0-99e3-48c1-845e-38fc3ec7ea3f","volumeId":187}] for volume [Volume {"id":187,"instanceId":8,"name":"p4-ng","uuid":"e44dceb6-93b5-40db-b418-278c83736c3b","volumeType":"DATADISK"}] failed due to [com.cloud.exception.InvalidParameterValueException: Snapshots of volumes on CLVM_NG storage require [snapshot.backup.to.secondary] to be true.]. com.cloud.exception.InvalidParameterValueException: Snapshots of volumes on CLVM_NG storage require [snapshot.backup.to.secondary] to be true.

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@RosiKyu I wasnt able to reproduce the issue on NFS, that said, no changes were made on that path in this PR to cause the issue. With regards to scheduled snaps / volume snaps in general, for clvm pool type, it is required that snapshot.backup.to.secondary be true, as revert doesnt work if kept of primary.

@Pearl1594

Copy link
Copy Markdown
Contributor Author

Also @RosiKyu - just as an improvement, rather than just logging the error, now the policy creation fails when a volume is on clvm pool type, so it's not hidden. I've also updated the docs to reflect the same.

@Pearl1594

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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.

@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
21.8% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube Cloud

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20270

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants