Skip to content

Commit 7b46749

Browse files
Do not include snapshots with Group type in snapshots resource count (#12945)
1 parent 68bd056 commit 7b46749

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

engine/schema/src/main/java/com/cloud/storage/dao/SnapshotDaoImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ protected void init() {
170170
CountSnapshotsByAccount.select(null, Func.COUNT, null);
171171
CountSnapshotsByAccount.and("account", CountSnapshotsByAccount.entity().getAccountId(), SearchCriteria.Op.EQ);
172172
CountSnapshotsByAccount.and("status", CountSnapshotsByAccount.entity().getState(), SearchCriteria.Op.NIN);
173+
CountSnapshotsByAccount.and("snapshotTypeNEQ", CountSnapshotsByAccount.entity().getSnapshotType(), SearchCriteria.Op.NIN);
173174
CountSnapshotsByAccount.and("removed", CountSnapshotsByAccount.entity().getRemoved(), SearchCriteria.Op.NULL);
174175
CountSnapshotsByAccount.done();
175176

@@ -220,6 +221,7 @@ public Long countSnapshotsForAccount(long accountId) {
220221
SearchCriteria<Long> sc = CountSnapshotsByAccount.create();
221222
sc.setParameters("account", accountId);
222223
sc.setParameters("status", State.Error, State.Destroyed);
224+
sc.setParameters("snapshotTypeNEQ", Snapshot.Type.GROUP.ordinal());
223225
return customSearch(sc, null).get(0);
224226
}
225227

0 commit comments

Comments
 (0)