diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java index 5d10c7f00db..c00785e7b0d 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java @@ -1382,8 +1382,8 @@ public class VolumeServiceImpl implements VolumeService { return; } - // we can only resume those uploaded volume with a URL specified - List dbVolumes = _volumeStoreDao.listUploadedVolumesByStoreId(storeId); + // find all the db volumes including those with NULL url column to avoid accidentally deleting volumes on image store later. + List dbVolumes = _volumeStoreDao.listByStoreId(storeId); List toBeDownloaded = new ArrayList(dbVolumes); for (VolumeDataStoreVO volumeStore : dbVolumes) { VolumeVO volume = volDao.findById(volumeStore.getVolumeId());