Skip to content

Commit 2611ac7

Browse files
committed
CLOUDSTACK-4454:object_store - Not able to delete secondary storage when
existing snapshots are deleted.
1 parent 75be7a9 commit 2611ac7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
6868
storeSearch = createSearchBuilder();
6969
storeSearch.and("store_id", storeSearch.entity().getDataStoreId(), SearchCriteria.Op.EQ);
7070
storeSearch.and("store_role", storeSearch.entity().getRole(), SearchCriteria.Op.EQ);
71+
storeSearch.and("state", storeSearch.entity().getState(), SearchCriteria.Op.NEQ);
7172
storeSearch.done();
7273

7374
destroyedSearch = createSearchBuilder();
@@ -147,6 +148,7 @@ public List<SnapshotDataStoreVO> listByStoreId(long id, DataStoreRole role) {
147148
SearchCriteria<SnapshotDataStoreVO> sc = storeSearch.create();
148149
sc.setParameters("store_id", id);
149150
sc.setParameters("store_role", role);
151+
sc.setParameters("state", ObjectInDataStoreStateMachine.State.Destroyed);
150152
return listBy(sc);
151153
}
152154

0 commit comments

Comments
 (0)