This is an automated email from the ASF dual-hosted git repository.
sureshanaparti pushed a commit to branch 4.22
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.22 by this push:
new 7b467496cb9 Do not include snapshots with Group type in snapshots
resource count (#12945)
7b467496cb9 is described below
commit 7b467496cb9e8c44a8eaeb186f93a77c4ebc6be6
Author: Suresh Kumar Anaparti <[email protected]>
AuthorDate: Fri Apr 10 10:50:35 2026 +0530
Do not include snapshots with Group type in snapshots resource count
(#12945)
---
engine/schema/src/main/java/com/cloud/storage/dao/SnapshotDaoImpl.java | 2 ++
1 file changed, 2 insertions(+)
diff --git
a/engine/schema/src/main/java/com/cloud/storage/dao/SnapshotDaoImpl.java
b/engine/schema/src/main/java/com/cloud/storage/dao/SnapshotDaoImpl.java
index 80e1b7d4d4b..f167b573187 100755
--- a/engine/schema/src/main/java/com/cloud/storage/dao/SnapshotDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/storage/dao/SnapshotDaoImpl.java
@@ -170,6 +170,7 @@ public class SnapshotDaoImpl extends
GenericDaoBase<SnapshotVO, Long> implements
CountSnapshotsByAccount.select(null, Func.COUNT, null);
CountSnapshotsByAccount.and("account",
CountSnapshotsByAccount.entity().getAccountId(), SearchCriteria.Op.EQ);
CountSnapshotsByAccount.and("status",
CountSnapshotsByAccount.entity().getState(), SearchCriteria.Op.NIN);
+ CountSnapshotsByAccount.and("snapshotTypeNEQ",
CountSnapshotsByAccount.entity().getSnapshotType(), SearchCriteria.Op.NIN);
CountSnapshotsByAccount.and("removed",
CountSnapshotsByAccount.entity().getRemoved(), SearchCriteria.Op.NULL);
CountSnapshotsByAccount.done();
@@ -220,6 +221,7 @@ public class SnapshotDaoImpl extends
GenericDaoBase<SnapshotVO, Long> implements
SearchCriteria<Long> sc = CountSnapshotsByAccount.create();
sc.setParameters("account", accountId);
sc.setParameters("status", State.Error, State.Destroyed);
+ sc.setParameters("snapshotTypeNEQ", Snapshot.Type.GROUP.ordinal());
return customSearch(sc, null).get(0);
}