File tree Expand file tree Collapse file tree
engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -268,7 +268,9 @@ public boolean deleteSnapshot(Long snapshotId) {
268268 SnapshotDataStoreVO snapshotOnPrimary = snapshotStoreDao .findBySnapshot (snapshotId , DataStoreRole .Primary );
269269 if (snapshotOnPrimary != null ) {
270270 SnapshotInfo snapshotOnPrimaryInfo = snapshotDataFactory .getSnapshot (snapshotId , DataStoreRole .Primary );
271- if (((PrimaryDataStoreImpl )snapshotOnPrimaryInfo .getDataStore ()).getPoolType () == StoragePoolType .RBD ) {
271+ long volumeId = snapshotOnPrimary .getVolumeId ();
272+ VolumeVO volumeVO = volumeDao .findById (volumeId );
273+ if (((PrimaryDataStoreImpl )snapshotOnPrimaryInfo .getDataStore ()).getPoolType () == StoragePoolType .RBD && volumeVO != null ) {
272274 snapshotSvr .deleteSnapshot (snapshotOnPrimaryInfo );
273275 }
274276 snapshotOnPrimary .setState (State .Destroyed );
You can’t perform that action at this time.
0 commit comments