RosiKyu commented on PR #14484:
URL: https://github.com/apache/cloudstack/pull/14484#issuecomment-7343958368

   @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 https://github.com/apache/cloudstack-documentation/pull/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.
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to